1 karl 1.3 //%2004////////////////////////////////////////////////////////////////////////
|
2 schuur 1.1 //
|
3 karl 1.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 schuur 1.1 //
10 // Permission is hereby granted, free of charge, to any person obtaining a copy
11 // of this software and associated documentation files (the "Software"), to
12 // deal in the Software without restriction, including without limitation the
13 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14 // sell copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions:
|
16 karl 1.3 //
|
17 schuur 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
18 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
19 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
20 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //
26 //==============================================================================
27 //
28 // Author: Chip Vincent (cvincent@us.ibm.com)
29 //
30 // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com)
31 // Jenny Yu, Hewlett-Packard Company(jenny_yu@hp.com)
32 // Mike Day, IBM (mdday@us.ibm.com)
33 // Adrian Schuur, schuur@de.ibm.com
34 //
35 //%/////////////////////////////////////////////////////////////////////////////
36
37 #ifndef Pegasus_JMPILocalProviderManager_h
38 schuur 1.1 #define Pegasus_JMPILocalProviderManager_h
39
40 #include <Pegasus/Common/Config.h>
41 #include <Pegasus/Common/String.h>
42 #include <Pegasus/Common/IPC.h>
43 #include <Pegasus/Common/DQueue.h>
44 #include <Pegasus/Common/HashTable.h>
45
46 #include <Pegasus/ProviderManager2/JMPI/JMPIProvider.h>
47 //#include <Pegasus/ProviderManager2/JMPI/JMPIResolverModule.h>
48
49 #include <Pegasus/ProviderManager2/Lockable.h>
50
51 #include <Pegasus/Server/Linkage.h>
52
53 PEGASUS_NAMESPACE_BEGIN
54
55 class PEGASUS_SERVER_LINKAGE JMPILocalProviderManager
56 {
57
58 public:
59 schuur 1.1 JMPILocalProviderManager(void);
60 virtual ~JMPILocalProviderManager(void);
61
62 public:
63 JMPIProvider::OpProviderHolder getProvider(const String & fileName, const String & providerName,
64 const String & interfaceName = String::EMPTY);
65
66 void unloadProvider(const String & fileName, const String & providerName);
67
68 void shutdownAllProviders(void);
69
|
70 kumpf 1.2 Boolean hasActiveProviders();
71 void unloadIdleProviders();
|
72 schuur 1.1
73 private:
74 enum CTRL
75 {
76 INSERT_PROVIDER,
77 INSERT_MODULE,
78 REMOVE_PROVIDER,
79 REMOVE_MODULE,
80 LOOKUP_PROVIDER,
81 LOOKUP_MODULE,
82 GET_PROVIDER,
83 UNLOAD_PROVIDER,
84 UNLOAD_ALL_PROVIDERS,
85 UNLOAD_IDLE_PROVIDERS,
86 UNLOAD_IDLE_MODULES
87 };
88
89 typedef HashTable<String, JMPIProvider *,
90 EqualFunc<String>, HashFunc<String> > ResolverTable;
91
92 typedef HashTable<String, JMPIProvider *,
93 schuur 1.1 EqualFunc<String>, HashFunc<String> > ProviderTable;
94
95 typedef HashTable<String, JMPIProviderModule *,
96 EqualFunc<String>, HashFunc<String> > ModuleTable;
97
98 typedef struct
99 {
100 const String *providerName;
101 const String *fileName;
102 const String *interfaceName;
103 } CTRL_STRINGS;
104
105 friend class ProviderManagerService;
106
107 ResolverTable _resolvers;
108 ProviderTable _providers;
109 ModuleTable _modules;
110 Uint32 _idle_timeout;
111
112 JMPIProvider *_getResolver(const String & fileName, const String & interfaceType);
113 // CMPIResolverModule *_loadResolver(const String & fileName);
114 schuur 1.1 Sint32 _provider_ctrl(CTRL code, void *parm, void *ret);
115
116 Mutex _mut;
117
118 protected:
119
120 };
121
122 PEGASUS_NAMESPACE_END
123
124 #endif
125
|