Manage client-side plug-ins and match them agains URLs. More...
#include <XrdClPlugInManager.hh>
Public Member Functions | |
| PlugInManager () | |
| Constructor. | |
| ~PlugInManager () | |
| Destructor. | |
| PlugInFactory * | GetFactory (const std::string url) |
| void | ProcessEnvironmentSettings () |
| bool | RegisterDefaultFactory (PlugInFactory *factory) |
| Register a plug-in factory applying to all URLs. | |
| bool | RegisterFactory (const std::string &url, PlugInFactory *factory) |
Friends | |
| class | ::PlugInManagerFixture |
Manage client-side plug-ins and match them agains URLs.
Definition at line 45 of file XrdClPlugInManager.hh.
| XrdCl::PlugInManager::PlugInManager | ( | ) |
Constructor.
Definition at line 52 of file XrdClPlugInManager.cc.
Referenced by ::PlugInManagerFixture.
| XrdCl::PlugInManager::~PlugInManager | ( | ) |
Destructor.
Definition at line 60 of file XrdClPlugInManager.cc.
| PlugInFactory * XrdCl::PlugInManager::GetFactory | ( | const std::string | url | ) |
Retrieve the plug-in factory for the given URL
Definition at line 146 of file XrdClPlugInManager.cc.
References XrdCl::URL::URL().
Referenced by XrdCl::FileSystem::FileSystem(), ::PlugInManagerFixture, and XrdCl::ThirdPartyCopy().
| 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) directory pointed to by XRD_PLUGINCONFDIR envvar 2) user directory: ~/.xrootd/client.plugins.d/ 3) system directory: /etc/xrootd/client.plugins.d/
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 enable - determines whether the plug-in should be enabled or not
You may use any other keys for your own purposes.
The first directory with a setting for a URL decides it, and the directories after it cannot change it. This applies to disabled plug-ins as well. Within one directory, the config files are processed in alphabetic order, and a setting for a URL found later supersedes the previous one. However, only the first enabled plug-in for all URLs ('url = *') is loaded. Any setting applied via environment or config files supersedes any setting done programmatically.
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 187 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.
Referenced by ::PlugInManagerFixture.
| 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 120 of file XrdClPlugInManager.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), and XrdCl::PlugInMgrMsg.
Referenced by ::PlugInManagerFixture.
| 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 76 of file XrdClPlugInManager.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), and XrdCl::PlugInMgrMsg.
Referenced by ::PlugInManagerFixture.
|
friend |
Definition at line 47 of file XrdClPlugInManager.hh.
References PlugInManager(), GetFactory(), ProcessEnvironmentSettings(), RegisterDefaultFactory(), and RegisterFactory().