![]() |
XRootD
|
Manage client-side plug-ins and match them agains URLs. More...
#include <XrdClPlugInManager.hh>
Public Member Functions | |
PlugInManager () | |
Constructor. More... | |
~PlugInManager () | |
Destructor. More... | |
PlugInFactory * | GetFactory (const std::string url) |
void | ProcessEnvironmentSettings () |
bool | RegisterDefaultFactory (PlugInFactory *factory) |
Register a plug-in factory applying to all URLs. More... | |
bool | RegisterFactory (const std::string &url, PlugInFactory *factory) |
Manage client-side plug-ins and match them agains URLs.
Definition at line 41 of file XrdClPlugInManager.hh.
XrdCl::PlugInManager::PlugInManager | ( | ) |
Constructor.
Definition at line 51 of file XrdClPlugInManager.cc.
XrdCl::PlugInManager::~PlugInManager | ( | ) |
Destructor.
Definition at line 59 of file XrdClPlugInManager.cc.
PlugInFactory * XrdCl::PlugInManager::GetFactory | ( | const std::string | url | ) |
Retrieve the plug-in factory for the given URL
Definition at line 145 of file XrdClPlugInManager.cc.
References XrdCl::URL::GetProtocol().
Referenced by XrdCl::FileSystem::FileSystem(), XrdCl::DefaultEnv::GetPlugInFactory(), and XrdCl::File::Open().
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.
Definition at line 186 of file XrdClPlugInManager.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultPlugIn, XrdCl::DefaultPlugInConfDir, XrdSysPwd::Get(), XrdCl::DefaultEnv::GetEnv(), XrdCl::DefaultEnv::GetLog(), XrdCl::Env::GetString(), and XrdCl::PlugInMgrMsg.
bool XrdCl::PlugInManager::RegisterDefaultFactory | ( | PlugInFactory * | factory | ) |
Register a plug-in factory applying to all URLs.
Register a plug-in factory applying to all URLs, registering a 0 pointer removes the factory
Definition at line 119 of file XrdClPlugInManager.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), and XrdCl::PlugInMgrMsg.
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
Definition at line 75 of file XrdClPlugInManager.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), and XrdCl::PlugInMgrMsg.