1 karl 1.12 //%2006////////////////////////////////////////////////////////////////////////
|
2 schuur 1.1 //
|
3 karl 1.7 // 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 karl 1.8 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.12 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 schuur 1.1 //
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 karl 1.7 //
|
21 schuur 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // 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_CMPILocalProviderManager_h
35 #define Pegasus_CMPILocalProviderManager_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/String.h>
39 #include <Pegasus/Common/HashTable.h>
|
40 kumpf 1.16 #include <Pegasus/Common/ArrayInternal.h>
|
41 schuur 1.1
42 #include <Pegasus/ProviderManager2/CMPI/CMPIProvider.h>
43
|
44 schuur 1.4 #include <Pegasus/ProviderManager2/CMPI/Linkage.h>
|
45 schuur 1.1
46 PEGASUS_NAMESPACE_BEGIN
47
|
48 schuur 1.4 class PEGASUS_CMPIPM_LINKAGE CMPILocalProviderManager
|
49 schuur 1.1 {
50
51 public:
|
52 venkat.puvvada 1.17 CMPILocalProviderManager();
53 virtual ~CMPILocalProviderManager();
|
54 schuur 1.1
55 public:
|
56 s.kodali 1.18.4.1 OpProviderHolder getProvider(
|
57 venkat.puvvada 1.17 const String & fileName,
58 const String & providerName);
59
|
60 s.kodali 1.18.4.1 OpProviderHolder getRemoteProvider(
|
61 venkat.puvvada 1.17 const String & fileName,
62 const String & providerName);
|
63 schuur 1.1
64 void unloadProvider(const String & fileName, const String & providerName);
65
|
66 venkat.puvvada 1.17 void shutdownAllProviders();
|
67 schuur 1.1
|
68 kumpf 1.5 Boolean hasActiveProviders();
69 void unloadIdleProviders();
|
70 schuur 1.1
|
71 carolann.graves 1.9 /**
72 Gets list of indication providers to be enabled.
73 Once IndicationService initialization has been completed, the
74 enableIndications() method must be called on each indication provider
75 that has current subscriptions.
76
77 @return list of providers whose enableIndications() method must be
78 called
79 */
80 Array <CMPIProvider *> getIndicationProvidersToEnable ();
|
81 venkat.puvvada 1.17 static void cleanupThread(Thread *t, CMPIProvider *p);
|
82 carolann.graves 1.9
|
83 schuur 1.1 private:
84 enum CTRL
85 {
86 INSERT_PROVIDER,
87 INSERT_MODULE,
88 LOOKUP_PROVIDER,
89 LOOKUP_MODULE,
90 GET_PROVIDER,
91 UNLOAD_PROVIDER,
92 UNLOAD_ALL_PROVIDERS,
|
93 schuur 1.3 UNLOAD_IDLE_PROVIDERS
|
94 schuur 1.1 };
95
96 typedef HashTable<String, CMPIProvider *,
97 EqualFunc<String>, HashFunc<String> > ResolverTable;
98
99 typedef HashTable<String, CMPIProvider *,
100 EqualFunc<String>, HashFunc<String> > ProviderTable;
101
102 typedef HashTable<String, CMPIProviderModule *,
103 EqualFunc<String>, HashFunc<String> > ModuleTable;
104
105 typedef struct
106 {
107 const String *providerName;
108 const String *fileName;
|
109 schuur 1.6 const String *location;
|
110 schuur 1.1 } CTRL_STRINGS;
111
112 ResolverTable _resolvers;
113 ProviderTable _providers;
114 ModuleTable _modules;
115 Uint32 _idle_timeout;
116 Sint32 _provider_ctrl(CTRL code, void *parm, void *ret);
117
|
118 dj.gorey 1.2 CMPIProvider* _initProvider(CMPIProvider * provider,
|
119 venkat.puvvada 1.17 const String & moduleFileName);
|
120 dj.gorey 1.2
121 void _unloadProvider(CMPIProvider * provider);
122
123 CMPIProvider * _lookupProvider(const String & providerName);
124
|
125 schuur 1.6 CMPIProviderModule * _lookupModule(const String & moduleFileName);
|
126 dj.gorey 1.2 Mutex _providerTableMutex;
|
127 venkat.puvvada 1.17
128 /*
129 * The cleaning functions for provider threads.
130 */
131
132 static ThreadReturnType PEGASUS_THREAD_CDECL _reaper(void *);
133
134 /*
135 * The data structures for holding the thread and the CMPIProvider
136 */
137
138 struct cleanupThreadRecord : public Linkable
139 {
140 cleanupThreadRecord(): thread(0), provider(0)
141 {
142 }
143 cleanupThreadRecord(Thread *t, CMPIProvider *p): thread(t), provider(p)
144 {
145 }
146 Thread *thread;
147 CMPIProvider *provider;
148 venkat.puvvada 1.17 };
149
150 static Thread* _reaperThread;
151 static Semaphore _pollingSem;
152 static AtomicInt _stopPolling;
153 static Mutex _reaperMutex;
154 static List<cleanupThreadRecord,Mutex> _finishedThreadList;
|
155 konrad.r 1.11
|
156 schuur 1.1 protected:
157
158 };
159
160 PEGASUS_NAMESPACE_END
161
162 #endif
163
|
164 venkat.puvvada 1.17
|