XrdCl::PlugInManager Class Reference

Manage client-side plug-ins and match them agains URLs. More...

#include <XrdClPlugInManager.hh>

Collaboration diagram for XrdCl::PlugInManager:
Collaboration graph
[legend]

List of all members.

Classes

struct  FactoryHelper

Public Member Functions

 PlugInManager ()
 Constructor.
 ~PlugInManager ()
 Destructor.
bool RegisterFactory (const std::string &url, PlugInFactory *factory)
bool RegisterDefaultFactory (PlugInFactory *factory)
PlugInFactoryGetFactory (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
FactoryHelperpDefaultFactory
XrdSysMutex pMutex

Detailed Description

Manage client-side plug-ins and match them agains URLs.


Member Typedef Documentation

typedef void*(* XrdCl::PlugInManager::PlugInFunc_t)(const void *arg) [private]

Constructor & Destructor Documentation

XrdCl::PlugInManager::PlugInManager (  ) 

Constructor.

XrdCl::PlugInManager::~PlugInManager (  ) 

Destructor.


Member Function Documentation

PlugInFactory* XrdCl::PlugInManager::GetFactory ( const std::string  url  ) 

Retrieve the plug-in factory for the given URL

Returns:
you do not own the returned memory
std::pair<XrdOucPinLoader*,PlugInFactory*> XrdCl::PlugInManager::LoadFactory ( const std::string &  lib,
const std::map< std::string, std::string > &  config 
) [private]

Load the plug-in and create the factory.

std::string XrdCl::PlugInManager::NormalizeURL ( const std::string  url  )  [private]

Normalize a URL.

void XrdCl::PlugInManager::ProcessConfigDir ( const std::string &  dir  )  [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:

 {.cpp}
 extern "C"
 {
   void *XrdClGetPlugIn( const void *arg )
   {
     return __your_plug_in_factory__;
   }
 }

where arg is a const pointer to std::map<std::string, std::string> containing the plug-in configuration.

void XrdCl::PlugInManager::ProcessPlugInConfig ( const std::string &  confFile  )  [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 &  urlString,
const std::string &  lib,
PlugInFactory factory,
XrdOucPinLoader plugin 
) [private]

Register factory, if successful it actuires ownership of the objects

Returns:
true if successfully registered
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


Member Data Documentation

std::map<std::string, FactoryHelper*> XrdCl::PlugInManager::pFactoryMap [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 22 Feb 2019 for xrootd by  doxygen 1.6.1