dmlite  0.6
Public Member Functions | Private Member Functions | Private Attributes | List of all members
dmlite::PluginManager Class Reference

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

#include <dmlite.h>

Public Member Functions

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

Private Member Functions

 PluginManager (const PluginManager &)
 Can not be copied. More...
 

Private Attributes

std::map< std::string, std::string > confValues_
 Configuration key/value. More...
 
std::list< AuthnFactory * > authn_plugins_
 Internal list of loaded plug-ins. More...
 
std::list< INodeFactory * > inode_plugins_
 
std::list< CatalogFactory * > catalog_plugins_
 
std::list< PoolManagerFactory * > pool_plugins_
 
std::list< IODriverFactory * > 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. More...
 

Detailed Description

CatalogInterface can only be instantiated through this class.

Constructor & Destructor Documentation

◆ PluginManager() [1/2]

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

Constructor.

◆ ~PluginManager()

dmlite::PluginManager::~PluginManager ( )

Destructor.

◆ PluginManager() [2/2]

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

Can not be copied.

Member Function Documentation

◆ configure()

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

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

Parameters
keyThe configuration parameter.
valueThe value for the configuration parameter.

◆ getAuthnFactory()

AuthnFactory* dmlite::PluginManager::getAuthnFactory ( )

Get the AuthnFactory implementation on top of the plugin stack.

◆ getCatalogFactory()

CatalogFactory* dmlite::PluginManager::getCatalogFactory ( )

Get the CatalogFactory implementation on top of the plugin stack.

◆ getConfiguration()

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

Return an entry from the loaded configuration.

Parameters
keyThe configuration parameter.

◆ getINodeFactory()

INodeFactory* dmlite::PluginManager::getINodeFactory ( )

◆ getIODriverFactory()

IODriverFactory* dmlite::PluginManager::getIODriverFactory ( )

Get the IOFactory implementation on top of the plugin stack.

◆ getPoolDriverFactory()

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

Get the appropiate pool driver factory for the pool.

◆ getPoolManagerFactory()

PoolManagerFactory* dmlite::PluginManager::getPoolManagerFactory ( )

Get the PoolFactory implementation on top of the plugin stack.

◆ loadConfiguration()

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

Load a configuration file, with plugins and parameters.

Parameters
fileThe configuration file.

◆ loadPlugin()

void dmlite::PluginManager::loadPlugin ( const std::string &  lib,
const std::string &  id 
)

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.

◆ registerAuthnFactory()

void dmlite::PluginManager::registerAuthnFactory ( AuthnFactory factory)

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.

◆ registerCatalogFactory()

void dmlite::PluginManager::registerCatalogFactory ( CatalogFactory factory)

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.

◆ registerConfigureFactory()

void dmlite::PluginManager::registerConfigureFactory ( BaseFactory factory)

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.

◆ registerINodeFactory()

void dmlite::PluginManager::registerINodeFactory ( INodeFactory factory)

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.

◆ registerIODriverFactory()

void dmlite::PluginManager::registerIODriverFactory ( IODriverFactory factory)

Register a IODriver 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.

◆ registerPoolDriverFactory()

void dmlite::PluginManager::registerPoolDriverFactory ( PoolDriverFactory factory)

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.

◆ registerPoolManagerFactory()

void dmlite::PluginManager::registerPoolManagerFactory ( PoolManagerFactory factory)

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

◆ authn_plugins_

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

Internal list of loaded plug-ins.

◆ catalog_plugins_

std::list<CatalogFactory*> dmlite::PluginManager::catalog_plugins_
private

◆ configure_factory_

std::list<BaseFactory*> dmlite::PluginManager::configure_factory_
private

◆ confValues_

std::map<std::string, std::string> dmlite::PluginManager::confValues_
private

Configuration key/value.

◆ dlHandles_

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

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

◆ inode_plugins_

std::list<INodeFactory*> dmlite::PluginManager::inode_plugins_
private

◆ io_plugins_

std::list<IODriverFactory*> dmlite::PluginManager::io_plugins_
private

◆ pool_driver_plugins_

std::list<PoolDriverFactory*> dmlite::PluginManager::pool_driver_plugins_
private

◆ pool_plugins_

std::list<PoolManagerFactory*> dmlite::PluginManager::pool_plugins_
private

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