OW_NAMESPACE::ProviderAgent Class Reference

#include <OW_ProviderAgent.hpp>

Inheritance diagram for OW_NAMESPACE::ProviderAgent:

Inheritance graph
Collaboration diagram for OW_NAMESPACE::ProviderAgent:

Collaboration graph
List of all members.

Public Member Functions

 ProviderAgent (const ConfigFile::ConfigMap &configMap, const Array< CppProviderBaseIFCRef > &providers, const Array< CIMClass > &classes, const Array< RequestHandlerIFCRef > &requestHandlers, const AuthenticatorIFCRef &authenticator, const LoggerRef &logger=LoggerRef(), const String &callbackURL=String(""), const ProviderAgentLockerIFCRef &locker=ProviderAgentLockerIFCRef(), const ProviderAgentLifecycleCallbackIFCRef &lifecycleCB=ProviderAgentLifecycleCallbackIFCRef())
 Create a new provider agent, and start the HTTP server.
virtual ~ProviderAgent ()
void shutdownHttpServer ()
 Shut down the http server embedded within the ProviderAgent.

Static Public Attributes

static const char *const LockingType_opt = "provider_agent.locking_type"
static const char *const LockingTypeNone = "none"
static const char *const LockingTypeSWMR = "swmr"
static const char *const LockingTypeSingleThreaded = "single_threaded"
static const char *const LockingTimeout_opt = "provider_agent.locking_timeout"
static const char *const DynamicClassRetrieval_opt = "provider_agent.dynamic_class_retrieval"
static const char *const UseConnectionCredentials_opt = "provider_agent.use_connection_credentials"

Private Attributes

HTTPServerRef m_httpServer
ThreadRef m_httpThread
UnnamedPipeRef m_stopHttpPipe
ProviderAgentLifecycleCallbackIFCRef m_lifecycleCB

Detailed Description

Definition at line 59 of file OW_ProviderAgent.hpp.

Constructor & Destructor Documentation

OW_NAMESPACE::ProviderAgent::ProviderAgent const ConfigFile::ConfigMap configMap,
const Array< CppProviderBaseIFCRef > &  providers,
const Array< CIMClass > &  classes,
const Array< RequestHandlerIFCRef > &  requestHandlers,
const AuthenticatorIFCRef authenticator,
const LoggerRef logger = LoggerRef(),
const String callbackURL = String(""),
const ProviderAgentLockerIFCRef locker = ProviderAgentLockerIFCRef(),
const ProviderAgentLifecycleCallbackIFCRef lifecycleCB = ProviderAgentLifecycleCallbackIFCRef()

Create a new provider agent, and start the HTTP server.

The ProviderAgent can be used as a stand alone process by creating a ProviderAgent within a fairly simple main(), or it can be embedded within an existing daemon or service.

A note about the CIMClasses. The ProviderAgent can work in a variety of situations:

1. No classes are available. PA ctor params: classes.empty() && (callbackURL.empty() || configMap[DynamicClassRetrieval_opt] != "true"). A CIMNULL CIMClass will be passed to the providers.

2. All classes are provided initially. PA ctor params: classes contains all the CIM classes which may be needed by the providers. The appropriate class will be passed to the provider as necessary.

3. Classes are retrieved as needed. PA ctor params: !callbackURL.empty() && configMap[DynamicClassRetrieval_opt] == "true". When a request comes in, if the appropriate class cannot be found in the cache, then it will be retrieved from the WBEM server identified by callbackURL.

configMap The configuration parameters for the ProviderAgent and its embedded HTTP server. This could possibly come from parsing a config file.
providers An array of providers to be embedded in the ProviderAgent. These should be a CppInstanceProvider, CppSecondaryInstanceProvider, CppMethodProvider, or CppAssociatorProvider, or a combination of these.
classes An array of CIMClasses. If the providers require CIMClasses to be passed into instance and associator calls, the appropriate classes should be placed in this array. The ProviderAgent will look up the appropriate class and pass it to the provider method calls as needed. NULL CIMClasses will be passed if the requested class is not found in the array. This is only a problem is the provider expects a real class.
requestHandlers An array of request handlers. The appropriate one will be used for each client request depending on the HTTP headers of the request. You can just put a single request handler in the array if you only wish to handle one type of encoding (CIM-XML, for example).
authenticator A reference to the authenticator to be used by the embedded HTTP server.
logger A reference to a logger to be used by the ProviderAgent (and passed to the embedded Provider).
callbackURL A URL to a CIMOM for providers to be able to make "upcalls" to the CIMOM. If the CIMOM requires authentication, the authentication credentials must be in the URL. If no callbackURL is provided, providers will be unable to callback to the CIMOM.
locker If non-null, this locker will be called to provide seralization for the agent operations. If null, then the config items LockingType_opt and LockingTimeout_opt will be used to control the locking.

Definition at line 145 of file OW_ProviderAgent.cpp.

References env, logger, m_httpServer, and m_httpThread.

OW_NAMESPACE::ProviderAgent::~ProviderAgent  )  [virtual]

Definition at line 174 of file OW_ProviderAgent.cpp.

References shutdownHttpServer().

Member Function Documentation

void OW_NAMESPACE::ProviderAgent::shutdownHttpServer  ) 

Shut down the http server embedded within the ProviderAgent.

This function blocks until all threads which may be processing requests have terminated.

Definition at line 188 of file OW_ProviderAgent.cpp.

References m_httpServer, and m_httpThread.

Referenced by ~ProviderAgent().

Member Data Documentation

const char *const OW_NAMESPACE::ProviderAgent::DynamicClassRetrieval_opt = "provider_agent.dynamic_class_retrieval" [static]

Definition at line 84 of file OW_ProviderAgent.hpp.

const char *const OW_NAMESPACE::ProviderAgent::LockingTimeout_opt = "provider_agent.locking_timeout" [static]

Definition at line 79 of file OW_ProviderAgent.hpp.

const char *const OW_NAMESPACE::ProviderAgent::LockingType_opt = "provider_agent.locking_type" [static]

Definition at line 65 of file OW_ProviderAgent.hpp.

const char *const OW_NAMESPACE::ProviderAgent::LockingTypeNone = "none" [static]

Definition at line 68 of file OW_ProviderAgent.hpp.

const char *const OW_NAMESPACE::ProviderAgent::LockingTypeSingleThreaded = "single_threaded" [static]

Definition at line 74 of file OW_ProviderAgent.hpp.

const char *const OW_NAMESPACE::ProviderAgent::LockingTypeSWMR = "swmr" [static]

Definition at line 71 of file OW_ProviderAgent.hpp.

HTTPServerRef OW_NAMESPACE::ProviderAgent::m_httpServer [private]

Definition at line 166 of file OW_ProviderAgent.hpp.

Referenced by ProviderAgent(), and shutdownHttpServer().

ThreadRef OW_NAMESPACE::ProviderAgent::m_httpThread [private]

Definition at line 167 of file OW_ProviderAgent.hpp.

Referenced by ProviderAgent(), and shutdownHttpServer().

ProviderAgentLifecycleCallbackIFCRef OW_NAMESPACE::ProviderAgent::m_lifecycleCB [private]

Definition at line 169 of file OW_ProviderAgent.hpp.

UnnamedPipeRef OW_NAMESPACE::ProviderAgent::m_stopHttpPipe [private]

Definition at line 168 of file OW_ProviderAgent.hpp.

const char *const OW_NAMESPACE::ProviderAgent::UseConnectionCredentials_opt = "provider_agent.use_connection_credentials" [static]

Definition at line 89 of file OW_ProviderAgent.hpp.

The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:15:33 2006 for openwbem by  doxygen 1.4.6