version 1.7.2.1, 2004/03/02 21:34:42
|
version 1.37, 2006/08/04 19:05:59
|
|
|
//%2003//////////////////////////////////////////////////////////////////////// |
//%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. |
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; | // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; |
// IBM Corp.; EMC Corporation, The Open Group. | // IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// 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 |
|
|
// (carolann_graves@hp.com) | // (carolann_graves@hp.com) |
// Mike Day, IBM (mdday@us.ibm.com) | // Mike Day, IBM (mdday@us.ibm.com) |
// Adrian Schuur, IBM (schuur@de.ibm.com) | // Adrian Schuur, IBM (schuur@de.ibm.com) |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#define Pegasus_ProviderManagerService_h | #define Pegasus_ProviderManagerService_h |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Thread.h> |
|
#include <Pegasus/Common/Array.h> |
|
#include <Pegasus/Common/Pair.h> |
|
#include <Pegasus/Common/MessageQueueService.h> | #include <Pegasus/Common/MessageQueueService.h> |
|
#include <Pegasus/Common/CIMMessage.h> |
|
#include <Pegasus/Common/OperationContextInternal.h> |
|
#include <Pegasus/Common/AutoPtr.h> |
|
#include <Pegasus/Common/List.h> |
|
#include <Pegasus/Common/Mutex.h> |
#include <Pegasus/Repository/CIMRepository.h> | #include <Pegasus/Repository/CIMRepository.h> |
|
#include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h> |
| |
#include <Pegasus/ProviderManager2/SafeQueue.h> |
#include <Pegasus/ProviderManager2/ProviderManagerRouter.h> |
| |
#include <Pegasus/ProviderManager2/Linkage.h> | #include <Pegasus/ProviderManager2/Linkage.h> |
| |
|
#ifdef PEGASUS_ZOS_SECURITY |
|
// This include file will not be provided in the OpenGroup CVS for now. |
|
// Do NOT try to include it in your compile |
|
#include <Pegasus/ProviderManager2/ProviderManagerzOS_inline.h> |
|
#endif |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class ProviderRegistrationManager; |
#define IDLE_LIMIT 300 |
class ProviderManager; |
|
| |
class PEGASUS_PPM_LINKAGE ProviderManagerService : public MessageQueueService | class PEGASUS_PPM_LINKAGE ProviderManagerService : public MessageQueueService |
{ | { |
friend class CMPIProviderManager; |
|
public: | public: |
static ProviderManagerService* providerManagerService; |
ProviderManagerService( |
|
ProviderRegistrationManager* providerRegistrationManager, |
ProviderManagerService(void); |
CIMRepository* repository, |
ProviderManagerService(ProviderRegistrationManager * providerRegistrationManager, |
ProviderManager* (*createDefaultProviderManagerCallback)()); |
CIMRepository * repository); |
|
|
virtual ~ProviderManagerService(); |
|
|
|
void unloadIdleProviders(); |
|
|
|
static void indicationCallback(CIMProcessIndicationRequestMessage* request); |
|
static void responseChunkCallback( |
|
CIMRequestMessage* request, CIMResponseMessage* response); |
|
|
|
/** |
|
Callback function to be called upon detection of failure of a |
|
provider module. |
|
*/ |
|
static void providerModuleFailureCallback (const String & moduleName, |
|
const String & userName, Uint16); |
| |
virtual ~ProviderManagerService(void); |
private: |
|
ProviderManagerService(); |
// temp |
|
void unload_idle_providers(void); |
|
| |
protected: |
|
virtual Boolean messageOK(const Message * message); | virtual Boolean messageOK(const Message * message); |
virtual void handleEnqueue(void); |
virtual void handleEnqueue(); |
virtual void handleEnqueue(Message * message); | virtual void handleEnqueue(Message * message); |
| |
virtual void _handle_async_request(AsyncRequest * request); | virtual void _handle_async_request(AsyncRequest * request); |
| |
static CIMRepository* _repository; |
static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL handleCimOperation( |
|
void* arg) ; |
| |
private: |
void handleCimRequest(AsyncOpNode* op, Message* message); |
//static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL handleServiceOperation(void * arg) throw(); |
|
| |
//void handleStartService() thorw(); |
Message* _processMessage(CIMRequestMessage* request); |
//void handleStopService() thorw(); |
|
//void handlePauseService() thorw(); |
|
//void handleResumeService() thorw(); |
|
| |
static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL handleCimOperation(void * arg) throw(); |
static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL |
|
_unloadIdleProvidersHandler(void* arg) throw(); |
| |
ProviderManager *locateProviderManager(const Message *m, String &itf); |
void _updateProviderModuleStatus( |
void handleCimRequest(AsyncOpNode *op, const Message * message); |
CIMInstance& providerModule, |
|
const Array<Uint16>& removeStatus, |
|
const Array<Uint16>& appendStatus); |
| |
private: |
static ProviderManagerService* providerManagerService; |
SafeQueue<AsyncOpNode *> _incomingQueue; |
|
SafeQueue<AsyncOpNode *> _outgoingQueue; |
CIMRepository* _repository; |
|
|
|
List<AsyncOpNode,Mutex> _incomingQueue; |
|
List<AsyncOpNode,Mutex> _outgoingQueue; |
|
|
|
ProviderManagerRouter* _basicProviderManagerRouter; |
|
ProviderManagerRouter* _oopProviderManagerRouter; |
|
|
|
ProviderRegistrationManager* _providerRegistrationManager; |
|
|
|
static Uint32 _indicationServiceQueueId; |
|
|
|
/** |
|
Indicates the number of threads currently attempting to unload idle |
|
providers. This value is used to prevent multiple threads from |
|
unloading idle providers at the same time. |
|
*/ |
|
AtomicInt _unloadIdleProvidersBusy; |
| |
private: |
|
//Array<Pair<ProviderManager *, ProviderManagerModule> > _providerManagers; |
|
| |
}; | }; |
| |
|
// Auto class to encapsulate enabling and disabling |
|
// of the pthread_security on z/OS |
|
// For all other platforms this should be an empty class |
|
// Targets: avoid ifdefs and keep code readable(clean) |
|
#ifndef PEGASUS_ZOS_THREADLEVEL_SECURITY |
|
// not z/OS == empty class |
|
class PEGASUS_PPM_LINKAGE AutoPThreadSecurity |
|
{ |
|
public: |
|
AutoPThreadSecurity(const OperationContext& context) {}; |
|
}; |
|
#else |
|
|
|
class PEGASUS_PPM_LINKAGE AutoPThreadSecurity |
|
{ |
|
public: |
|
AutoPThreadSecurity(const OperationContext& context) |
|
{ |
|
int err_num=enablePThreadSecurity(context); |
|
if (err_num!=0) |
|
{ |
|
// need a new CIMException for this |
|
throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num))); |
|
} |
|
}; |
|
|
|
~AutoPThreadSecurity() |
|
{ |
|
disablePThreadSecurity(); |
|
}; |
|
}; |
|
|
|
#endif |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif | #endif |