xrootd
|
Manage client-side plug-ins and match them agains URLs. More...
#include <XrdClPlugInManager.hh>
Classes | |
struct | FactoryHelper |
Public Member Functions | |
PlugInManager () | |
Constructor. | |
~PlugInManager () | |
Destructor. | |
bool | RegisterFactory (const std::string &url, PlugInFactory *factory) |
bool | RegisterDefaultFactory (PlugInFactory *factory) |
PlugInFactory * | GetFactory (const std::string url) |
void | ProcessEnvironmentSettings () |
Private Types | |
typedef void *(* | PlugInFunc_t) (const void *arg) |
Private Member Functions | |
void | ProcessConfigDir (const std::string &dir) |
Process the configuration directory and load plug in definitions. | |
void | ProcessPlugInConfig (const std::string &confFile) |
Process a plug-in config file and load the plug-in if possible. | |
std::pair< XrdOucPinLoader *, PlugInFactory * > | LoadFactory (const std::string &lib, const std::map< std::string, std::string > &config) |
Load the plug-in and create the factory. | |
bool | RegisterFactory (const std::string &urlString, const std::string &lib, PlugInFactory *factory, XrdOucPinLoader *plugin) |
std::string | NormalizeURL (const std::string url) |
Normalize a URL. | |
Private Attributes | |
std::map< std::string, FactoryHelper * > | pFactoryMap |
FactoryHelper * | pDefaultFactory |
XrdSysMutex | pMutex |
Manage client-side plug-ins and match them agains URLs.
|
private |
XrdCl::PlugInManager::PlugInManager | ( | ) |
Constructor.
XrdCl::PlugInManager::~PlugInManager | ( | ) |
Destructor.
PlugInFactory * XrdCl::PlugInManager::GetFactory | ( | const std::string | url | ) |
Retrieve the plug-in factory for the given URL
|
private |
Load the plug-in and create the factory.
|
private |
Normalize a URL.
|
private |
Process the configuration directory and load plug in definitions.
void XrdCl::PlugInManager::ProcessEnvironmentSettings | ( | ) |
Process user environment to load plug-in settings.
This will try to load a default plug-in from a library pointed to by the XRD_PLUGIN envvar. If this fails it will scan the configuration files located in:
1) system directory: /etc/xrootd/client.plugins.d/ 2) user direvtory: ~/.xrootd/client.plugins.d/ 3) directory pointed to by XRD_PLUGINCONFDIR envvar
In that order.
The configuration files contain lines with key-value pairs in the form of 'key=value'.
Mandatory keys are: url - a semicolon separated list of URLs the plug-in applies to lib - plugin library to be loaded enabled - determines whether the plug-in should be enabled or not
You may use any other keys for your own purposes.
The config files are processed in alphabetic order, any satteing found later superseeds the previous one. Any setting applied via environment or config files superseeds any setting done programatically.
The plug-in library must implement the following C function:
where arg is a const pointer to std::map<std::string, std::string> containing the plug-in configuration.
|
private |
Process a plug-in config file and load the plug-in if possible.
bool XrdCl::PlugInManager::RegisterDefaultFactory | ( | PlugInFactory * | factory | ) |
Register a plug-in factory applying to all URLs, registering a 0 pointer removes the factory
bool XrdCl::PlugInManager::RegisterFactory | ( | const std::string & | url, |
PlugInFactory * | factory | ||
) |
Register a plug-in factory for the given url, registering a 0 pointer removes the factory for the url
|
private |
Register factory, if successful it actuires ownership of the objects
|
private |
|
private |
|
private |