1 schuur 1.1 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000 - 2003 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRgACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 schuur 1.1 //==============================================================================
23 //
24 // Author: Chip Vincent (cvincent@us.ibm.com)
25 //
26 // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com)
27 // Mike Day, IBM (mdday@us.ibm.com)
28 // Adrian Schuur, schuur@de.ibm.com
|
30 schuur 1.1 //
31 //%/////////////////////////////////////////////////////////////////////////////
32
33 #ifndef Pegasus_CMPIProvider_h
34 #define Pegasus_CMPIProvider_h
35
36 #include "CMPI_Object.h"
37 #include "CMPI_Broker.h"
38
39 #include <Pegasus/Common/Config.h>
40 #include <Pegasus/Common/IPC.h>
41 #include <Pegasus/Provider/CIMOMHandle.h>
42 #include <Pegasus/Provider/CIMInstanceProvider.h>
43 #include <Pegasus/Provider/CIMAssociationProvider.h>
44 #include <Pegasus/Provider/CIMMethodProvider.h>
45
46 #include <Pegasus/ProviderManager2/CMPI/CMPIResolverModule.h>
47
48 #include <Pegasus/Server/Linkage.h>
49
50 PEGASUS_NAMESPACE_BEGIN
51 schuur 1.1
52 class CMPIProviderModule;
53 class CMPIResolverModule;
54
55 #define CMPI_MIType_Instance 1
56 #define CMPI_MIType_Association 2
57 #define CMPI_MIType_Method 4
58 #define CMPI_MIType_Property 8
59 #define CMPI_MIType_Indication 16
60
61
62 typedef CMPIInstanceMI* (*CREATE_INST_MI)(CMPIBroker*,CMPIContext*);
63 typedef CMPIAssociationMI* (*CREATE_ASSOC_MI)(CMPIBroker*,CMPIContext*);
64 typedef CMPIMethodMI* (*CREATE_METH_MI)(CMPIBroker*,CMPIContext*);
65 typedef CMPIPropertyMI* (*CREATE_PROP_MI)(CMPIBroker*,CMPIContext*);
66 typedef CMPIIndicationMI* (*CREATE_IND_MI)(CMPIBroker*,CMPIContext*);
67
68 typedef CMPIInstanceMI* (*CREATE_GEN_INST_MI)(CMPIBroker*,CMPIContext*,const char*);
69 typedef CMPIAssociationMI* (*CREATE_GEN_ASSOC_MI)(CMPIBroker*,CMPIContext*,const char*);
70 typedef CMPIMethodMI* (*CREATE_GEN_METH_MI)(CMPIBroker*,CMPIContext*,const char*);
71 typedef CMPIPropertyMI* (*CREATE_GEN_PROP_MI)(CMPIBroker*,CMPIContext*,const char*);
72 schuur 1.1 typedef CMPIIndicationMI* (*CREATE_GEN_IND_MI)(CMPIBroker*,CMPIContext*,const char*);
73
74 struct ProviderVector {
75 int miTypes;
76 int genericMode;
77 CMPIInstanceMI *instMI;
78 CMPIAssociationMI *assocMI;
79 CMPIMethodMI *methMI;
80 CMPIPropertyMI *propMI;
81 CMPIIndicationMI *indMI;
82 CREATE_INST_MI createInstMI;
83 CREATE_ASSOC_MI createAssocMI;
84 CREATE_METH_MI createMethMI;
85 CREATE_PROP_MI createPropMI;
86 CREATE_IND_MI createIndMI;
87 CREATE_GEN_INST_MI createGenInstMI;
88 CREATE_GEN_ASSOC_MI createGenAssocMI;
89 CREATE_GEN_METH_MI createGenMethMI;
90 CREATE_GEN_PROP_MI createGenPropMI;
91 CREATE_GEN_IND_MI createGenIndMI;
92 };
93 schuur 1.1
94 // The CMPIProvider class represents the logical provider extracted from a
95 // provider module. It is wrapped in a facade to stabalize the interface
96 // and is directly tied to a module.
97
98 class PEGASUS_SERVER_LINKAGE CMPIProvider :
99 public virtual CIMProvider
100 {
101 public:
102
103 enum Status
104 {
|
107 schuur 1.1 };
108
109 public:
110
111
112 class pm_service_op_lock {
113 private:
114 pm_service_op_lock(void);
115 public:
116 pm_service_op_lock(CMPIProvider *provider) : _provider(provider)
117 { _provider->protect(); }
118 ~pm_service_op_lock(void)
119 { _provider->unprotect(); }
120 CMPIProvider * _provider;
121 };
122
123 // typedef CMPIProviderFacade Base;
124
125 CMPIProvider(const String & name,
126 CMPIProviderModule *module,
127 ProviderVector *mv);
128 schuur 1.1 CMPIProvider(CMPIProvider*);
129
130 virtual ~CMPIProvider(void);
131
132 virtual void initialize(CIMOMHandle & cimom);
133 static void initialize(CIMOMHandle & cimom,
134 ProviderVector & miVector,
135 String & name,
136 CMPI_Broker & broker);
137
138 virtual Boolean tryTerminate(void);
139 virtual void terminate(void);
140 virtual void _terminate(void);
141
|