version 1.20, 2005/02/25 21:44:18
|
version 1.28, 2006/08/29 17:48:56
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Chip Vincent (cvincent@us.ibm.com) |
|
// |
|
// Modified By: |
|
// Nag Boranna, Hewlett-Packard Company(nagaraja_boranna@hp.com) |
|
// Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com) |
|
// Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) |
|
// Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
|
// Mike Day, IBM (mdday@us.ibm.com) |
|
// Adrian Schuur (schuur@de.ibm.com) |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_DefaultProviderManager_h | #ifndef Pegasus_DefaultProviderManager_h |
|
|
#include <Pegasus/Common/Constants.h> | #include <Pegasus/Common/Constants.h> |
#include <Pegasus/Common/CIMObjectPath.h> | #include <Pegasus/Common/CIMObjectPath.h> |
#include <Pegasus/Common/Pair.h> | #include <Pegasus/Common/Pair.h> |
#include <Pegasus/Common/Triad.h> |
|
#include <Pegasus/Common/Thread.h> | #include <Pegasus/Common/Thread.h> |
#include <Pegasus/Common/HashTable.h> | #include <Pegasus/Common/HashTable.h> |
#include <Pegasus/Common/OperationContextInternal.h> | #include <Pegasus/Common/OperationContextInternal.h> |
|
|
#include <Pegasus/ProviderManager2/ProviderManager.h> | #include <Pegasus/ProviderManager2/ProviderManager.h> |
#include <Pegasus/ProviderManager2/ProviderName.h> | #include <Pegasus/ProviderManager2/ProviderName.h> |
| |
#include <Pegasus/ProviderManager2/Default/LocalProviderManager.h> |
#include <Pegasus/ProviderManager2/Default/ProviderMessageHandler.h> |
#include <Pegasus/ProviderManager2/OperationResponseHandler.h> |
|
#include <Pegasus/ProviderManager2/Default/Provider.h> |
|
|
|
#include <Pegasus/ProviderManager2/Default/Linkage.h> | #include <Pegasus/ProviderManager2/Default/Linkage.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
typedef HashTable<String, |
|
EnableIndicationsResponseHandler *, |
|
EqualFunc<String>, |
|
HashFunc<String> > IndicationResponseTable; |
|
|
|
class PEGASUS_DEFPM_LINKAGE DefaultProviderManager : public ProviderManager | class PEGASUS_DEFPM_LINKAGE DefaultProviderManager : public ProviderManager |
{ | { |
public: | public: |
DefaultProviderManager(void); |
DefaultProviderManager(); |
virtual ~DefaultProviderManager(void); |
virtual ~DefaultProviderManager(); |
| |
virtual Message * processMessage(Message * request); | virtual Message * processMessage(Message * request); |
| |
virtual Boolean hasActiveProviders(); | virtual Boolean hasActiveProviders(); |
virtual void unloadIdleProviders(); | virtual void unloadIdleProviders(); |
| |
protected: |
// This function creates an instance of DefaultProviderManager. It is |
Message * handleUnsupportedRequest(const Message * message); |
// typically passed to either the ProviderManagerService constructor |
|
// or the BasicProviderManagerRouter constructor as a way of decoupling |
|
// the pegprovidermanager and DefaultProviderManager libraries (otherwise |
|
// each library would contain a reference to the other). |
|
static ProviderManager* createDefaultProviderManagerCallback(); |
| |
Message * handleGetInstanceRequest(const Message * message); |
private: |
Message * handleEnumerateInstancesRequest(const Message * message); |
Message* _handleDisableModuleRequest(Message* message); |
Message * handleEnumerateInstanceNamesRequest(const Message * message); |
Message* _handleEnableModuleRequest(Message* message); |
Message * handleCreateInstanceRequest(const Message * message); |
Message* _handleStopAllProvidersRequest(Message* message); |
Message * handleModifyInstanceRequest(const Message * message); |
Message* _handleInitializeProviderRequest(Message* message); |
Message * handleDeleteInstanceRequest(const Message * message); |
Message* _handleSubscriptionInitCompleteRequest(Message* message); |
|
|
Message * handleExecQueryRequest(const Message * message); |
|
|
|
Message * handleAssociatorsRequest(const Message * message); |
|
Message * handleAssociatorNamesRequest(const Message * message); |
|
Message * handleReferencesRequest(const Message * message); |
|
Message * handleReferenceNamesRequest(const Message * message); |
|
|
|
Message * handleGetPropertyRequest(const Message * message); |
|
Message * handleSetPropertyRequest(const Message * message); |
|
|
|
Message * handleInvokeMethodRequest(const Message * message); |
|
|
|
Message * handleCreateSubscriptionRequest(const Message * message); |
|
Message * handleModifySubscriptionRequest(const Message * message); |
|
Message * handleDeleteSubscriptionRequest(const Message * message); |
|
|
|
Message * handleExportIndicationRequest(const Message * message); |
|
|
|
Message * handleDisableModuleRequest(const Message * message); |
|
Message * handleEnableModuleRequest(const Message * message); |
|
Message * handleStopAllProvidersRequest(const Message * message); |
|
Message * handleInitializeProviderRequest(const Message * message); |
|
Message * handleSubscriptionInitCompleteRequest |
|
(const Message * message); |
|
| |
void _insertEntry(const Provider & provider, const EnableIndicationsResponseHandler *handler); |
ProviderName _resolveProviderName(const ProviderIdContainer & providerId); |
EnableIndicationsResponseHandler * _removeEntry(const String & key); |
|
| |
String _generateKey(const Provider & provider); |
ProviderOperationCounter _getProvider( |
String _generateKey(const String & providerName,const String & providerFileName); |
const String& moduleFileName, |
|
const String& providerName); |
| |
ProviderName _resolveProviderName(const ProviderIdContainer & providerId); |
ProviderMessageHandler* _lookupProvider(const String& providerName); |
| |
protected: |
ProviderMessageHandler* _initProvider( |
IndicationResponseTable _responseTable; |
ProviderMessageHandler* provider, |
LocalProviderManager providerManager; |
const String& moduleFileName); |
| |
private: |
ProviderModule* _lookupModule(const String& moduleFileName); |
|
|
|
void _shutdownAllProviders(); |
|
|
|
Sint16 _disableProvider(const String& providerName); |
|
|
|
void _unloadProvider(ProviderMessageHandler* provider); |
| |
/** | /** |
Calls the provider's enableIndications() method. |
The _providerTableMutex must be locked whenever accessing the |
If successful, the indications response handler is stored in the |
_providers table or the _modules table. It is okay to lock a |
_responseTable. |
ProviderStatus::_statusMutex while holding the _providerTableMutex, |
|
but one should never lock the _providerTableMutex while holding |
@param req_provider CIMInstance for the provider to be enabled |
a ProviderStatus::_statusMutex. |
@param _indicationCallback PEGASUS_INDICATION_CALLBACK for indications |
|
@param ph OpProviderHolder for the provider to be enabled |
|
|
|
Note that since an exception thrown by the provider's |
|
enableIndications() method is considered a provider error, any such |
|
exception is ignored, and no exceptions are thrown by this method. |
|
*/ | */ |
void _callEnableIndications |
Mutex _providerTableMutex; |
(CIMInstance & req_provider, |
|
PEGASUS_INDICATION_CALLBACK _indicationCallback, |
typedef HashTable<String, ProviderMessageHandler*, |
OpProviderHolder & ph); |
EqualFunc<String>, HashFunc<String> > ProviderTable; |
|
|
|
typedef HashTable<String, ProviderModule*, |
|
EqualFunc<String>, HashFunc<String> > ModuleTable; |
|
|
|
ProviderTable _providers; |
|
ModuleTable _modules; |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |