1 kumpf 1.1 //%2006////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
11 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
13 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 kumpf 1.1 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_ProviderManagerService_h
35 #define Pegasus_ProviderManagerService_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/MessageQueueService.h>
39 #include <Pegasus/Common/CIMMessage.h>
40 #include <Pegasus/Common/OperationContextInternal.h>
41 #include <Pegasus/Common/AutoPtr.h>
42 #include <Pegasus/Common/List.h>
43 kumpf 1.1 #include <Pegasus/Common/Mutex.h>
44 #include <Pegasus/Repository/CIMRepository.h>
|
48 kumpf 1.1 #include <Pegasus/ProviderManagerService/ProviderManagerRouter.h>
49 #include <Pegasus/ProviderManagerService/Linkage.h>
50
51 PEGASUS_NAMESPACE_BEGIN
52
53 class PEGASUS_PMS_LINKAGE ProviderManagerService : public MessageQueueService
54 {
55 public:
56 ProviderManagerService(
57 ProviderRegistrationManager* providerRegistrationManager,
58 CIMRepository* repository,
|
60 kumpf 1.1
61 virtual ~ProviderManagerService();
62
63 void unloadIdleProviders();
64
65 static void indicationCallback(CIMProcessIndicationRequestMessage* request);
66 static void responseChunkCallback(
67 CIMRequestMessage* request, CIMResponseMessage* response);
68
69 /**
70 Callback function to be called upon detection of failure of a
71 provider module.
72 */
73 static void providerModuleFailureCallback (const String & moduleName,
74 const String & userName, Uint16);
75
76 private:
77 ProviderManagerService();
78
79 virtual Boolean messageOK(const Message* message);
80 virtual void handleEnqueue();
81 kumpf 1.1 virtual void handleEnqueue(Message* message);
82
83 virtual void _handle_async_request(AsyncRequest* request);
84
85 static ThreadReturnType PEGASUS_THREAD_CDECL handleCimOperation(
86 void* arg) ;
87
88 void handleCimRequest(AsyncOpNode* op, Message* message);
89
90 Message* _processMessage(CIMRequestMessage* request);
91
92 static ThreadReturnType PEGASUS_THREAD_CDECL
93 _unloadIdleProvidersHandler(void* arg) throw();
94
95 void _updateProviderModuleStatus(
96 CIMInstance& providerModule,
97 const Array<Uint16>& removeStatus,
98 const Array<Uint16>& appendStatus);
99
100 static ProviderManagerService* providerManagerService;
101
102 kumpf 1.1 CIMRepository* _repository;
103
104 List<AsyncOpNode,Mutex> _incomingQueue;
105 List<AsyncOpNode,Mutex> _outgoingQueue;
106
107 Boolean _forceProviderProcesses;
108 ProviderManagerRouter* _basicProviderManagerRouter;
109 ProviderManagerRouter* _oopProviderManagerRouter;
110
111 ProviderRegistrationManager* _providerRegistrationManager;
112
113 static Uint32 _indicationServiceQueueId;
114
115 /**
116 Indicates the number of threads currently attempting to unload idle
117 providers. This value is used to prevent multiple threads from
118 unloading idle providers at the same time.
119 */
120 AtomicInt _unloadIdleProvidersBusy;
121 };
122
123 kumpf 1.1 PEGASUS_NAMESPACE_END
124
125 #endif
|