BUG#: 4973
[tpot/pegasus/.git] / readme.jmpi
1 //%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 //
21 // 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 Java Manageability Programming Interface - JMPI
33
34 Author: Adrian Schuur, schuur@de.ibm.com  - 30 Apr 2004 -
35
36 First installment
37
38    This installment of JMPI has been committed to the 2.4 branch.
39    This installment has been build and tested on Suse 9.0 with Sun's j2sdk 1.4.2_04.
40
41
42 Environment settings
43
44    In order to build this support a few environment variables have to used.
45    The following script has been proven useful for setting up the build and execution environment.
46    You might need to adjust this to your system layout.
47
48    export PEGASUS_HOME=`pwd`
49    export PEGASUS_PLATFORM=LINUX_IX86_GNU
50    export PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=1
51    export PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER=1
52    export PEGASUS_DEBUG=1
53    export JAVA_SDK=/usr/java/j2sdk1.4.2_04
54    export JAVA_SDKINC=$JAVA_SDK/include
55    export LD_LIBRARY_PATH=$PEGASUS_HOME/lib:$JAVA_SDK/jre/lib/i386/server:$JAVA_SDK/jre/lib/i386/native_threads:$JAVA_SDK/jre/lib/i386
56    export PATH=$JAVA_SDK/bin:$PATH
57    export CLASSPATH=$PEGASUS_ROOT/src/Pegasus/ProviderManager2/JMPI
58    export PATH=$PEGASUS_HOME/bin:$PATH
59    export PEGASUS_ROOT=$PEGASUS_HOME
60    export LD_ASSUME_KERNEL=2.2.5
61    cd $PEGASUS_HOME
62
63    There is now a new variable to determine which JVM to link with.  The choices are as follows:
64         PEGASUS_JVM     sun     Sun's jvm (ex: j2sdk1.4.2_07)
65         PEGASUS_JVM     ibm     IBM's jvm (ex: IBMJava2-142)
66         PEGASUS_JVM     bea     Suse's IBM jvm (ex: BEAJava2-1.4.2)
67    So, pick one and export that variable to the environment.  For example,
68         export PEGASUS_JVM=sun
69    NOTE: This is currently listened to for Linux builds.
70
71    There are a couple of optional environment variables to determine how the JRE is initialized.  These are
72    as follows (the variable name and what JRE option that it corresponds to):
73
74    PEGASUS_JMPI_MAX_HEAP               -Xmx
75    PEGASUS_JMPI_INITIAL_HEAP           -Xms
76    PEGASUS_JMPI_JAVA_THREAD_STACK_SIZE -Xss
77
78    So, for example, you would perform the following if you want to change the maximum heap size to 128 megabytes.
79
80    export PEGASUS_JMPI_MAX_HEAP=128m
81
82    There is a new environment variable that tells the JVM to output more debugging information.  The variable name
83    is called PEGASUS_JMPI_VERBOSE.  An example usage is as follows:
84
85    export PEGASUS_JMPI_VERBOSE="jni,class"
86
87    This will tell the JVM to output debug information on the JNI layer and class loading.
88
89    When using this script, place a copy of this script above your PEGASUS_HOME directory.
90    "cd" to PEGASUS_HOME, and issue ". ../setJPeg". Then do a normal make.
91
92
93 This installment has a number of restrictios:
94
95    The provider interfaces follow the SNIA OpenWBEM APIs
96    Only Instance and Association providers are supported at the moment.
97    Unloading of idle providers is not supported and Java will increase the memory footprint.
98
99
100 poststarttests
101
102    This installment has a set of tests modelled after wetest/static.
103    For the tests, I had to modify "diff" to "diff -w", why that is needed I do not understand.
104
105
106 Building poststarttests:
107
108    cd to .../src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests/Load
109    Issue "make"
110
111    This will load a schema to the repository and register the provider.
112
113
114 Running poststarttests:
115
116    cd to .../src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests
117    Issue "find -name "*.rsp" -exec rm {} \;" to clean up *.rsp files
118    Issue "make poststarttests"
119
120
121 Samples
122
123    The provider used for posstarttest,
124         .../JMPI/org/pegasus/jmpi/test/JMPI_TestPropertyTypes/JMPI_TestPropertyTest.java is a working
125         example of how to code an JMPI tyle instance provider.
126         This directors also constains the required Makefile.
127
128         .../JMPI/org/pegasus/jmpi/sample contains more samples, one of which is an incomplete CIMClient
129         sample.
130
131         Notice that all provider classes must be accessibe via the CASSPATH environment setting.
132
133
134 Provider Registration
135
136    JMPI providers are registered as usual. The Location property in P_ProviderModule has a special format.
137         The format is: <jar-file-name>:<provider-class-name>
138
139    instance of PG_ProviderModule
140    {
141       Name = "JMPI_TestPropertyTypesModule";
142       Location = "JMPI_TestPropertyTypes.jar:org/pegasus/jmpi/tests/JMPI_TestPropertyTypes/JMPI_TestPropertyTypes";
143       Vendor = "Pegasus Community";
144       Version = "2.0.0";
145       InterfaceType = "JMPI";
146       InterfaceVersion = "1.0.0";
147    };
148
149    JMPI providers now fall into two groups.
150    1) Legacy providers use:
151       InterfaceType = "JMPI"
152    and use one of the 3 following based on existing JMPI samples:
153       InterfaceVersion = "1.0.0";
154       InterfaceVersion = "2.0.0";
155       InterfaceVersion = "2.2.0";
156    Note that there is no difference in behavior in the three versions.
157    2) New style providers use:
158       InterfaceType = "JMPIExperimental"
159    and:
160       InterfaceVersion = "0.0.1";
161
162
163 Bug reports
164
165    Use normal Pegasus bugzilla procedures to report malfunctions.
166
167
168 Regards, Adrian Schuur.
169
170