dmlite  0.6
Public Member Functions | Private Member Functions | Private Attributes
dmlite::PluginManager Class Reference

CatalogInterface can only be instantiated through this class. More...

#include <dmlite.h>

List of all members.

Public Member Functions

 PluginManager () throw ()
 Constructor.
 ~PluginManager ()
 Destructor.
void loadPlugin (const std::string &lib, const std::string &id) throw (DmException)
void configure (const std::string &key, const std::string &value) throw (DmException)
void loadConfiguration (const std::string &file) throw (DmException)
std::string getConfiguration (const std::string &key) throw (DmException)
void registerAuthnFactory (AuthnFactory *factory) throw (DmException)
void registerINodeFactory (INodeFactory *factory) throw (DmException)
void registerCatalogFactory (CatalogFactory *factory) throw (DmException)
void registerPoolManagerFactory (PoolManagerFactory *factory) throw (DmException)
void registerIOFactory (IOFactory *factory) throw (DmException)
void registerPoolDriverFactory (PoolDriverFactory *factory) throw (DmException)
void registerConfigureFactory (BaseFactory *factory) throw (DmException)
AuthnFactorygetAuthnFactory () throw (DmException)
 Get the AuthnFactory implementation on top of the plugin stack.
INodeFactorygetINodeFactory () throw (DmException)
CatalogFactorygetCatalogFactory () throw (DmException)
 Get the CatalogFactory implementation on top of the plugin stack.
PoolManagerFactorygetPoolManagerFactory () throw (DmException)
 Get the PoolFactory implementation on top of the plugin stack.
PoolDriverFactorygetPoolDriverFactory (const std::string &pooltype) throw (DmException)
 Get the appropiate pool driver factory for the pool.
IOFactorygetIOFactory () throw (DmException)
 Get the IOFactory implementation on top of the plugin stack.

Private Member Functions

 PluginManager (const PluginManager &)
 Can not be copied.

Private Attributes

std::map< std::string,
std::string > 
confValues_
 Configuration key/value.
std::list< AuthnFactory * > authn_plugins_
 Internal list of loaded plug-ins.
std::list< INodeFactory * > inode_plugins_
std::list< CatalogFactory * > catalog_plugins_
std::list< PoolManagerFactory * > pool_plugins_
std::list< IOFactory * > io_plugins_
std::list< PoolDriverFactory * > pool_driver_plugins_
std::list< BaseFactory * > configure_factory_
std::list< void * > dlHandles_
 Keep pointers returned by dlopen at hand to free on destruction.

Detailed Description

CatalogInterface can only be instantiated through this class.


Constructor & Destructor Documentation

dmlite::PluginManager::PluginManager ( ) throw ()

Constructor.

dmlite::PluginManager::~PluginManager ( )

Destructor.

dmlite::PluginManager::PluginManager ( const PluginManager )
private

Can not be copied.


Member Function Documentation

void dmlite::PluginManager::configure ( const std::string &  key,
const std::string &  value 
) throw (DmException)

Set a configuration parameter. It will be passed to the loaded plugins.

Parameters:
keyThe configuration parameter.
valueThe value for the configuration parameter.
AuthnFactory* dmlite::PluginManager::getAuthnFactory ( ) throw (DmException)

Get the AuthnFactory implementation on top of the plugin stack.

CatalogFactory* dmlite::PluginManager::getCatalogFactory ( ) throw (DmException)

Get the CatalogFactory implementation on top of the plugin stack.

std::string dmlite::PluginManager::getConfiguration ( const std::string &  key) throw (DmException)

Return an entry from the loaded configuration.

Parameters:
keyThe configuration parameter.
INodeFactory* dmlite::PluginManager::getINodeFactory ( ) throw (DmException)
IOFactory* dmlite::PluginManager::getIOFactory ( ) throw (DmException)

Get the IOFactory implementation on top of the plugin stack.

PoolDriverFactory* dmlite::PluginManager::getPoolDriverFactory ( const std::string &  pooltype) throw (DmException)

Get the appropiate pool driver factory for the pool.

PoolManagerFactory* dmlite::PluginManager::getPoolManagerFactory ( ) throw (DmException)

Get the PoolFactory implementation on top of the plugin stack.

void dmlite::PluginManager::loadConfiguration ( const std::string &  file) throw (DmException)

Load a configuration file, with plugins and parameters.

Parameters:
fileThe configuration file.
void dmlite::PluginManager::loadPlugin ( const std::string &  lib,
const std::string &  id 
) throw (DmException)

Load a plugin. Previously instantiated interfaces won't be affected.

Parameters:
libThe .so file. Usually, (path)/plugin_name.so.
idThe plugin ID. Usually, plugin_name.
void dmlite::PluginManager::registerAuthnFactory ( AuthnFactory factory) throw (DmException)

Register a Authn factory. To be used by concrete implementations

Parameters:
factoryThe UserDbGroup concrete factory.
Note:
The same object can be passed to other register functions. DMLite will take care of freeing it only once.
void dmlite::PluginManager::registerCatalogFactory ( CatalogFactory factory) throw (DmException)

Register a catalog factory. To be used by concrete implementations (i.e. Plugins)

Parameters:
factoryThe catalog concrete factory.
Note:
The same object can be passed to other register functions. DMLite will take care of freeing it only once.
void dmlite::PluginManager::registerConfigureFactory ( BaseFactory factory) throw (DmException)

Register a bare BaseFactory. Only the configure method will be called.

Parameters:
factoryThe BaseFactory.
Note:
The same object can be passed to other register functions. DMLite will take care of freeing it only once.
void dmlite::PluginManager::registerINodeFactory ( INodeFactory factory) throw (DmException)

Register a INode factory. To be used by concrete implementations (i.e. Plugins)

Parameters:
factoryThe INode concrete factory.
Note:
The same object can be passed to other register functions. DMLite will take care of freeing it only once.
void dmlite::PluginManager::registerIOFactory ( IOFactory factory) throw (DmException)

Register a IO factory.

Parameters:
factoryThe IO concrete factory.
Note:
The same object can be passed to other register functions. DMLite will take care of freeing it only once.
void dmlite::PluginManager::registerPoolDriverFactory ( PoolDriverFactory factory) throw (DmException)

Register a PoolDriver factory.

Parameters:
factoryThe PoolDriver factory.
Note:
The same object can be passed to other register functions. DMLite will take care of freeing it only once.
void dmlite::PluginManager::registerPoolManagerFactory ( PoolManagerFactory factory) throw (DmException)

Register a pool factory.

Parameters:
factoryThe pool concrete factory.
Note:
The same object can be passed to other register functions. DMLite will take care of freeing it only once.

Member Data Documentation

std::list<AuthnFactory*> dmlite::PluginManager::authn_plugins_
private

Internal list of loaded plug-ins.

std::list<CatalogFactory*> dmlite::PluginManager::catalog_plugins_
private
std::list<BaseFactory*> dmlite::PluginManager::configure_factory_
private
std::map<std::string, std::string> dmlite::PluginManager::confValues_
private

Configuration key/value.

std::list<void*> dmlite::PluginManager::dlHandles_
private

Keep pointers returned by dlopen at hand to free on destruction.

std::list<INodeFactory*> dmlite::PluginManager::inode_plugins_
private
std::list<IOFactory*> dmlite::PluginManager::io_plugins_
private
std::list<PoolDriverFactory*> dmlite::PluginManager::pool_driver_plugins_
private
std::list<PoolManagerFactory*> dmlite::PluginManager::pool_plugins_
private

The documentation for this class was generated from the following file: