Java Dynamic Management Kit 3.2 Programming Guide | ||||
---|---|---|---|---|
![]() | ![]() | Chapter 13. Class and Library Loading Service | ![]() | ![]() |
The class and library server serves classes and libraries to the class loader and the library loader. It is provided as the Java class com.sun.jaw.impl.server.rmi.NetClassServerImpl. It works in conjunction with the RMI network class loader provided with the Java Dynamic Management Kit.
The supplied server runs as a stand-alone Java program. However, it is implemented as an m-bean. This enables it to be integrated with a Java Dynamic Management agent and managed through the AdaptorMO interface.
Note - The class and library server does not support JAR files or ZIP files.
To start the server, type this command:
java [options] com.sun.jaw.impl.server.rmi.NetClassServerImpl |
If there is no RMI registry running on the machine where the server is started, the server starts the registry and registers itself.
You can specify the following system properties:
-DDEBUG
Specifies that debug messages are printed.
-Dclasspath=classpath
Specifies the search path for Java classes. The directories in this search path must not contain .jar or .zip files. By default it is the current directory.
-Dlibpath=libpath
Specifies the search path for libraries. By default it is the current directory.
-Dport=portno
Specifies the port number for RMI access. By default it is 1099.
-Dservice=servicename
Specifies the service name for registering the server object with the RMI registry. By default it is NetClassServer.
-Ddirfile=directivefile
Specifies the code signing directive file to be used.
In the example shown in Example 13-1, trace messages are printed and Java classes are searched for in the /project/netman/mbeans and /project/servman/mbeans directories.
Example 13-1. Starting the Class and Library Server
java -DDEBUG -Dclasspath=/project/netman/mbeans:/project/servman/mbeans com.sun.jaw.impl.server.rmi.NetClassServerImpl |
When you start the server, you have to specify the search paths for locating:
Java classes
Native libraries
These paths can be retrieved and updated dynamically, either by using the RMI interface defined by the server, or by using the AdaptorMO interface if the server is integrated with a Java Dynamic Management agent.
The directive file is a properties file that defines the following properties:
signer -- the keystore alias for the signer.
keystore -- the keystore (database file) location. This defaults to the file .keystore in the user's home directory, as determined by the user.home system property.
storepass -- the password used to protect the integrity of the keystore.
storetype -- the type of keystore to be instantiated. The default keystore type is the one that is specified as the value of the keystore.type property in the security properties file. The default keystore type is returned by the static getDefaultType() method in java.security.KeyStore.
keypass -- the password used to protect the private key of the generated key pair.
For further information, see the keytool documentation provided with JavaŽ 2 SDK.
Any class and library server you implement must implement the com.sun.jaw.impl.server.rmi.NetClassServer interface.
![]() | ![]() | ![]() |
Class and Library Loading Service | ![]() | Class and Library Loader |