1 karl 1.9 //%2004////////////////////////////////////////////////////////////////////////
|
2 sage 1.1 //
|
3 karl 1.9 // 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 karl 1.7 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.9 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 sage 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 kumpf 1.3 //
|
17 sage 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: Markus Mueller (sedgewick_de@yahoo.de)
29 //
|
30 mday 1.6 // Modified By: Adrian Schuur - schuur@de.ibm.com
|
31 a.arora 1.8 // Amit K Arora, (amita@in.ibm.com) for PEP101
|
32 sage 1.1 //
33 //%/////////////////////////////////////////////////////////////////////////////
34
35 #ifndef Pegasus_ProviderAdapter_h
36 #define Pegasus_ProviderAdapter_h
37
38 #include <Pegasus/Common/Config.h>
39 #include <Pegasus/Common/String.h>
40 #include <Pegasus/Common/System.h>
41 #include <Pegasus/Common/Sharable.h>
42 #include <Pegasus/Common/IPC.h>
|
43 a.arora 1.8 #include <Pegasus/Common/AutoPtr.h>
|
44 sage 1.1
|
45 kumpf 1.5 #include <Pegasus/Provider/CIMProvider.h>
|
46 kumpf 1.4 #include <Pegasus/Server/Linkage.h>
|
47 sage 1.1
48 PEGASUS_NAMESPACE_BEGIN
49
50 //
51 // the ProviderAdapter serves as a coupling between a
|
52 kumpf 1.5 // CIMProvider and an arbitrary file
|
53 sage 1.1
54 class PEGASUS_SERVER_LINKAGE ProviderAdapter
55 {
56 public:
57 ProviderAdapter(const String & adapterName,
58 const String & providerName,
|
59 mday 1.6 const String & modName);
|
60 sage 1.1 virtual ~ProviderAdapter(void);
61 const String & getAdapterName(void) const;
62 const String & getProviderName(void) const;
|
63 kumpf 1.5 virtual CIMProvider * getProvider(void) const;
|
64 sage 1.1
65 protected:
|
66 mday 1.6 String _adapterName; //_adapterName;
67 String _providerLocation;
|
68 sage 1.1 String _providerName;
69 String _className;
|
70 a.arora 1.8 AutoPtr<CIMProvider> _adapter; //PEP101
|
71 sage 1.1 };
72
73 //
74 // this class manages all adapters
75 //
76
77 class PEGASUS_SERVER_LINKAGE ProviderAdapterManager
78 {
79 public:
80 ProviderAdapterManager(void);
81 virtual ~ProviderAdapterManager(void);
82
83 ProviderAdapter * addAdapter(const String & adapterName,
84 const String & adapterFileName,
|
85 mday 1.6 const String & providerLocation,
86 const String & providerName);
|
87 sage 1.1 void deleteAdapter(const String & adapterName);
88 void deleteAdapter(const DynamicLibraryHandle & adapterlib);
89 static ProviderAdapterManager * get_pamgr();
90 void list(void);
91
92 private:
93 Array<String> _listOfAdapterNames;
94 Array<ProviderAdapter *> _listOfAdapters;
95 Array<DynamicLibraryHandle> _listOfAdapterLibs;
96 Array<Uint32> _listOfAdapterCounts;
97 Mutex _listMutex;
|
98 mday 1.6 DynamicLibraryHandle loadAdapter(const String & adapterName,
|
99 sage 1.1 const String & adapterFileName);
|
100 mday 1.6 ProviderAdapter * loadProvider(const DynamicLibraryHandle & library,
|
101 sage 1.1 const String & adapterName,
|
102 mday 1.6 const String & providerLocation,
103 const String & providerName);
|
104 sage 1.1 };
105
106 PEGASUS_NAMESPACE_END
107
108 #endif /* ProviderAdapter_h */
|