version 1.4, 2003/10/22 14:26:12
|
version 1.4.4.2, 2004/03/03 10:53:21
|
|
|
// | // |
// Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com) | // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com) |
// Mike Day, IBM (mdday@us.ibm.com) | // Mike Day, IBM (mdday@us.ibm.com) |
|
// Dan Gorey, IBM djgorey@us.ibm.com |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#include <Pegasus/ProviderManager2/Default/ProviderModule.h> | #include <Pegasus/ProviderManager2/Default/ProviderModule.h> |
#include <Pegasus/ProviderManager2/Default/ProviderFacade.h> | #include <Pegasus/ProviderManager2/Default/ProviderFacade.h> |
| |
#include <Pegasus/Server/Linkage.h> |
#include <Pegasus/ProviderManager2/Default/Linkage.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
// provider module. It is wrapped in a facade to stabalize the interface | // provider module. It is wrapped in a facade to stabalize the interface |
// and is directly tied to a module. | // and is directly tied to a module. |
| |
class PEGASUS_SERVER_LINKAGE Provider : public ProviderFacade |
class PEGASUS_DEFPM_LINKAGE Provider : public ProviderFacade |
{ | { |
public: | public: |
enum Status | enum Status |
{ | { |
UNKNOWN, |
UNINITIALIZED, |
INITIALIZING, |
INITIALIZED |
INITIALIZED, |
|
TERMINATING, |
|
TERMINATED |
|
}; | }; |
| |
public: | public: |
|
|
virtual void initialize(CIMOMHandle & cimom); | virtual void initialize(CIMOMHandle & cimom); |
virtual void terminate(void); | virtual void terminate(void); |
| |
Status getStatus(void) const; |
Status getStatus(void); |
String getName(void) const; | String getName(void) const; |
| |
ProviderModule *getModule(void) const; | ProviderModule *getModule(void) const; |
|
|
// allow provider manager to unload when idle | // allow provider manager to unload when idle |
virtual void unprotect(void); | virtual void unprotect(void); |
| |
|
void set(ProviderModule *module, |
|
CIMProvider *base, |
|
CIMOMHandle *cimomHandle); |
|
|
|
void reset(); |
|
|
protected: | protected: |
Status _status; | Status _status; |
ProviderModule *_module; | ProviderModule *_module; |
|
CIMProvider *getCIMProvider(); |
private: | private: |
friend class LocalProviderManager; | friend class LocalProviderManager; |
friend class ProviderManagerService; | friend class ProviderManagerService; |
|
|
String _name; | String _name; |
AtomicInt _no_unload; | AtomicInt _no_unload; |
Uint32 _quantum; | Uint32 _quantum; |
|
Mutex _statusMutex; |
}; | }; |
| |
| |
|
|
return(*_provider); | return(*_provider); |
} | } |
| |
|
CIMProvider* GetCIMProvider() |
|
{ |
|
return _provider->getCIMProvider(); |
|
} |
|
|
OpProviderHolder& operator=( const OpProviderHolder& x ) | OpProviderHolder& operator=( const OpProviderHolder& x ) |
{ | { |
if(this == &x) | if(this == &x) |