1 karl 1.7 //%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 mark.hamzy 1.8 //
|
21 karl 1.7 // 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 schuur 1.1
|
32 mark.hamzy 1.9 Java Manageability Programming Interface (JMPI)
33 -----------------------------------------------
|
34 schuur 1.1
|
35 mark.hamzy 1.9 JMPI is a bridge between clients and providers written in Java and the Open
36 Pegasus project.
|
37 schuur 1.1
|
38 mark.hamzy 1.13 More information on JMPI's status can be found at
|
39 mark.hamzy 1.9 http://www.openpegasus.org/page.tpl?ggid=799
|
40 r.kieninger 1.3
|
41 schuur 1.1
42 Environment settings
|
43 mark.hamzy 1.9 --------------------
|
44 schuur 1.1
|
45 mark.hamzy 1.16 In order to build this support a few environment variables have to used.
46 The following script has been proven useful for setting up the build and execution environment.
47 You might need to adjust this to your system layout.
|
48 schuur 1.1
|
49 mark.hamzy 1.16 an example setJPeg script file:
|
50 schuur 1.1 export PEGASUS_HOME=`pwd`
|
51 mark.hamzy 1.9 export PEGASUS_ROOT=${PEGASUS_HOME}
|
52 schuur 1.1 export PEGASUS_PLATFORM=LINUX_IX86_GNU
|
53 mark.hamzy 1.9 export PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER=true
|
54 mark.hamzy 1.12 export PEGASUS_JVM=sun
|
55 mark.hamzy 1.9 export JAVA_SDK=/usr/java/j2sdk1.4.2_08
56 export JAVA_SDKINC=${JAVA_SDK}/include
|
57 mark.hamzy 1.12 export PEGASUS_JAVA_ARCH=i386
|
58 mark.hamzy 1.13 export PEGASUS_JAVA_TYPE=client
|
59 mark.hamzy 1.12 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${JAVA_SDK}/jre/lib/${PEGASUS_JAVA_ARCH}/server:${JAVA_SDK}/jre/lib/${PEGASUS_JAVA_ARCH}/native_threads:${JAVA_SDK}/jre/lib/${PEGASUS_JAVA_ARCH}
|
60 mark.hamzy 1.9 export PATH=${JAVA_SDK}/bin/:${PEGASUS_HOME}/bin:${PATH}
61 export CLASSPATH=${CLASSPATH}:${PEGASUS_HOME}/lib/JMPIImpl.jar
62
|
63 mark.hamzy 1.16 Lets walk through the manditory environment variables. The first tells Pegasus to build the
64 Java provider manager.
65 export PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER=true
66
67 The second says which JRE to use. The choices are as follows:
68 export PEGASUS_JVM=gcj Gnu's jvm (ex: gcj (GCC) 4.1.1 20061011 (Red Hat 4.1.1-30))
69 export PEGASUS_JVM=sun Sun's jvm (ex: j2sdk1.4.2_07)
70 export PEGASUS_JVM=ibm IBM's jvm (ex: IBMJava2-142)
71 export PEGASUS_JVM=ibm64 IBM's jvm for 64 bit machine.
72 export PEGASUS_JVM=bea Suse's IBM jvm (ex: BEAJava2-1.4.2)
73 So, pick one and export that variable to the environment. For example,
74 export PEGASUS_JVM=sun
75 NOTE: The gcj and sun options were the only tested JVMs.
76 NOTE: gcj is only supported using gcc version 4.1.1 or later.
77
78 The third and fourth say where the JRE libraries and header files are located. This may or may not
79 be necessary depending upon the compiler's default search paths.
80 Since we are using Sun's JRE, point to Sun's paths.
81 export JAVA_SDK=/usr/java/j2sdk1.4.2_08
82 export JAVA_SDKINC=${JAVA_SDK}/include
|
83 mark.hamzy 1.12
|
84 mark.hamzy 1.16 The fifth variable defines the Java architecture of the JMV
85 export PEGASUS_JAVA_ARCH=i386
|
86 mark.hamzy 1.12
|
87 mark.hamzy 1.16 The sixth variable defines which version of the jvm library to link to (the
88 client or the server).
89 export PEGASUS_JAVA_TYPE=client
90
91 As a test to make sure your environment variables are correct
92 ls ${JAVA_SDK}/jre/lib/${PEGASUS_JAVA_ARCH}/${PEGASUS_JAVA_TYPE}
93 should show you libjvm.so for Sun's JRE.
94
95 The seventh may be necessary to tell the linker where to load the JRE libraries.
96 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${JAVA_SDK}/jre/lib/${PEGASUS_JAVA_ARCH}/server:${JAVA_SDK}/jre/lib/${PEGASUS_JAVA_ARCH}/native_threads:${JAVA_SDK}/jre/lib/${PEGASUS_JAVA_ARCH}
97
98 The eighth one may be necessary to get the JVM's executable files into the PATH.
99 export PATH=${JAVA_SDK}/bin/:${PEGASUS_HOME}/bin:${PATH}
100
101 The nineth tells the JRE to include JMPI's Java classes.
102 export CLASSPATH=${CLASSPATH}:${PEGASUS_HOME}/lib/JMPIImpl.jar
103
104 There are a couple of optional environment variables to determine how the JRE is initialized. These are
105 as follows (the variable name and what JRE option that it corresponds to):
106
107 PEGASUS_JMPI_MAX_HEAP -Xmx
108 mark.hamzy 1.16 PEGASUS_JMPI_INITIAL_HEAP -Xms
109 PEGASUS_JMPI_JAVA_THREAD_STACK_SIZE -Xss
110
111 So, for example, you would perform the following if you want to change the maximum heap size to 128 megabytes.
112
113 export PEGASUS_JMPI_MAX_HEAP=128m
114
115 There is a new optional environment variable that tells the JVM to output more debugging information. The variable name
116 is called PEGASUS_JMPI_VERBOSE. An example usage is as follows:
117
118 export PEGASUS_JMPI_VERBOSE="jni,class"
119
120 This will tell the JVM to output debug information on the JNI layer and class loading.
121
122 When using this script, place a copy of this script above your PEGASUS_HOME directory.
123 "cd" to PEGASUS_HOME, and issue ". ./setJPeg". Then do a normal make.
|
124 mark.hamzy 1.6
|
125 schuur 1.1
|
126 mark.hamzy 1.9 Known restrictions
127 ------------------
|
128 schuur 1.1
|
129 mark.hamzy 1.16 This installment has the following restrictios:
|
130 schuur 1.1
|
131 mark.hamzy 1.16 Unloading of idle providers is not supported and Java will increase the memory footprint.
|
132 mark.hamzy 1.9 Java 1.5 is not currently supported.
133
134
|
135 mark.hamzy 1.16 Level of coverage
136 -----------------
|
137 mark.hamzy 1.9
|
138 mark.hamzy 1.16 All interfaces to a provider have a sample provider written for them and are part of the
139 testcases. All main CIM java classes have testcases written for them as well.
|
140 mark.hamzy 1.9
141
142 Outstanding issues
143 ------------------
144
145 Java documentation needs to be written for the classes and methods within JMPI.
146
147
148 Testing
149 -------
150
|
151 mark.hamzy 1.16 This installment has a set of tests located under src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests/
|
152 schuur 1.1
|
153 mark.hamzy 1.16 Static/
|
154 schuur 1.1
|
155 mark.hamzy 1.16 These tests have been modelled after wetest/static.
156 For the tests, I had to modify "diff" to "diff -w", why that is needed I do not understand.
|
157 schuur 1.1
|
158 mark.hamzy 1.9 Providers/
|
159 schuur 1.1
|
160 mark.hamzy 1.9 These tests implement the many variants of provider interfaces.
|
161 schuur 1.1
|
162 mark.hamzy 1.9 Client/
|
163 schuur 1.1
|
164 mark.hamzy 1.9 These tests test out the client code and various Java classes.
165
166
167 Running the tests
168 -----------------
169
170 Tests are run with the following process.
|
171 mark.hamzy 1.16 If the repository has not been built before then issue the following:
|
172 mark.hamzy 1.9
173 cd to ${PEGASUS_HOME}/src/Pegasus/ProviderManager2/JMPI/
174 Issue "make repository"
|
175 schuur 1.1
176 This will load a schema to the repository and register the provider.
177
|
178 mark.hamzy 1.9 Next, run the tests.
|
179 schuur 1.1
|
180 mark.hamzy 1.9 cd to ${PEGASUS_HOME}/src/Pegasus/ProviderManager2/JMPI/
181 Issue "find -name \*.rsp -exec rm {} \;" to clean up *.rsp files from failed tests.
|
182 schuur 1.1 Issue "make poststarttests"
183
184
185 Samples
|
186 mark.hamzy 1.9 -------
187
188 There are four sample providers located in
189 ${PEGASUS_HOME}/src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests/Providers/
190
191 Associations/
192
193 This provider implements an association provider.
194
195 Instances/
196
197 This provider implements an instance provider.
198
199 Indications/
|
200 schuur 1.1
|
201 mark.hamzy 1.9 This provider implements an indication provider.
|
202 schuur 1.1
|
203 mark.hamzy 1.9 Properties/
|
204 schuur 1.1
|
205 mark.hamzy 1.9 This provider implements a property provider.
206
207 There is also sample Java code that deals with CIM classes that is located in
208 ${PEGASUS_HOME}/src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests/Client/
|
209 schuur 1.1
210
211 Provider Registration
|
212 mark.hamzy 1.9 ---------------------
|
213 schuur 1.1
|
214 mark.hamzy 1.16 JMPI providers are registered as usual. The Location property in PG_ProviderModule has a special format.
215 The format is: <jar-file-name>:<provider-class-name>
|
216 schuur 1.1
|
217 mark.hamzy 1.16 JMPI providers now fall into two groups.
218 1) Legacy providers use:
|
219 mark.hamzy 1.8 InterfaceType = "JMPI"
|
220 mark.hamzy 1.16 and use one of the 3 following based on existing JMPI samples:
|
221 mark.hamzy 1.8 InterfaceVersion = "1.0.0";
222 InterfaceVersion = "2.0.0";
223 InterfaceVersion = "2.2.0";
|
224 mark.hamzy 1.16 Note that there is no difference in behavior in the three versions.
|
225 mark.hamzy 1.9
|
226 mark.hamzy 1.16 instance of PG_ProviderModule
227 {
228 Name = "JMPIInstanceProviderModule";
229 Location = "JMPIInstanceProvider.jar:Instances/JMPIInstanceProvider";
230 Vendor = "OpenPegasus";
231 Version = "2.0.0";
232 InterfaceType = "JMPI";
233 InterfaceVersion = "1.0.0";
234 };
|
235 mark.hamzy 1.9
|
236 mark.hamzy 1.16 2) New style providers use:
|
237 mark.hamzy 1.8 InterfaceType = "JMPIExperimental"
|
238 mark.hamzy 1.16 and:
|
239 mark.hamzy 1.8 InterfaceVersion = "0.0.1";
240
|
241 mark.hamzy 1.16 instance of PG_ProviderModule
242 {
243 Name = "JMPIExpInstanceProviderModule";
244 Location = "JMPIExpInstanceProvider.jar:Instances/JMPIExpInstanceProvider";
245 Vendor = "OpenPegasus";
246 Version = "2.0.0";
247 InterfaceType = "JMPIExperimental";
248 InterfaceVersion = "0.0.1";
249 };
|
250 mark.hamzy 1.9
|
251 schuur 1.1
252 Bug reports
|
253 mark.hamzy 1.9 -----------
|
254 schuur 1.1
|
255 r.kieninger 1.3 Use normal Pegasus bugzilla procedures to report malfunctions.
|