com.sun.jaw.impl.server.rmi
Class NetClassServerImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.sun.jaw.impl.server.rmi.NetClassServerImpl

public class NetClassServerImpl
extends java.rmi.server.UnicastRemoteObject
implements NetClassServer, ActivatableIf

The NetClassServerImpl class is a basic implementation of a network class and library server based on the Java remote method invocation (RMI) system. This class can be used as a standalone server or included as an m-bean in a Java Dynamic Management agent.

To start the server, type this command:

prompt% java com.sun.jaw.impl.server.rmi.NetClassServerImpl

When starting the server, you have to specify the search paths for locating:

You can specify the following system properties:
DEBUG
Specifies that trace information is printed. See the Debug class definition for more information
.
dirfile
The directive file containing the signer and the certificate to be used for signing the classes in this server.
classpath
The search path for requested Java classes.
libpath
The search path for requested native libraries.
port
The port to be used for RMI access.
service
The RMI service name.
By default the server registers at rmi://localhost:1099/NetClassServer.

If an RMI registry is not running, the server starts one and then registers with it.

The network class and library server works in conjunction with the RMI loader.

See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
NetClassServerImpl()
          Required when using the class server as an m-bean in a Java Dynamic Management agent.
NetClassServerImpl(java.lang.String service, java.lang.String paths, java.lang.String lib, int port, java.lang.String dirfile)
          Required when using the class server as a standalone Java program.
 
Method Summary
 ClassDefinition getClass(java.lang.String className)
          Searches for the requested Java class on the management server.
 java.util.Vector getClassPaths()
          Returns the class path currently used by the network class and library server.
 java.lang.String getClassVersion()
          Returns the version of this class.
 java.util.Vector getLibPaths()
          Returns the library path currently used by the network class and library server.
 LibraryDefinition getLibrary(LibraryDefinition libdef)
          Returns a LibraryDefinition from the management server for the requested library.
 ObjectName getName()
           
 java.lang.String getServiceName()
           
 void initCmf(Framework cmf, ObjectName name, boolean db, ModificationList list)
          For JDMK internal use only.
 boolean isActive()
          Tests if the NetClassServerImpl is active.
static void main(java.lang.String[] args)
           
 void performStart()
          Activates the NetClassServerImpl.
 void performStop()
          Deactivates the NetClassServerImpl.
 void setClassPaths(java.util.Vector newValue)
          Sets the class path to be used by the network class and library server.
 void setLibPaths(java.util.Vector newValue)
          Sets the library path to be used by the network class and library server.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NetClassServerImpl

public NetClassServerImpl()
                   throws java.rmi.RemoteException
Required when using the class server as an m-bean in a Java Dynamic Management agent.
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.

NetClassServerImpl

public NetClassServerImpl(java.lang.String service,
                          java.lang.String paths,
                          java.lang.String lib,
                          int port,
                          java.lang.String dirfile)
                   throws java.rmi.RemoteException
Required when using the class server as a standalone Java program.
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.
Method Detail

main

public static void main(java.lang.String[] args)

initCmf

public void initCmf(Framework cmf,
                    ObjectName name,
                    boolean db,
                    ModificationList list)
             throws InstanceAlreadyExistException,
                    java.lang.IllegalArgumentException
For JDMK internal use only.

Initializes the NetClassServer service. This method declares the object specified to an instance of the core management framework. The name of the object must contain:

Parameters:
agent - The core management framework to register the service with.
name - Object name.
db - Indicates if persistent storage is required.
list - The modification list to use for setting up parameters.
Throws:
InstanceAlreadyExistException - The m-bean is already registered in the repository.
java.lang.IllegalArgumentException - One of the arguments passed to the method is illegal or inappropriate.

getClass

public ClassDefinition getClass(java.lang.String className)
                         throws java.rmi.RemoteException,
                                java.io.IOException,
                                java.lang.ClassNotFoundException
Searches for the requested Java class on the management server. An enumeration of class paths is retrieved from como and each path is searched in turn for the requested class.
Specified by:
getClass in interface NetClassServer
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.
java.io.IOException - Signals that an I/O exception of some sort has occurred.
java.lang.ClassNotFoundException - The specified class could not be found.

getLibrary

public LibraryDefinition getLibrary(LibraryDefinition libdef)
                             throws java.rmi.RemoteException,
                                    java.io.IOException,
                                    NoSuchLibException
Returns a LibraryDefinition from the management server for the requested library. The library definition contains the actual library bytes as one of its attributes.
Specified by:
getLibrary in interface NetClassServer
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.
java.io.IOException - Signals that an I/O exception of some sort has occurred.
NoSuchLibException - The specified native library could not be found.

performStart

public void performStart()
Activates the NetClassServerImpl.
Specified by:
performStart in interface ActivatableIf

performStop

public void performStop()
Deactivates the NetClassServerImpl.
Specified by:
performStop in interface ActivatableIf

isActive

public boolean isActive()
Tests if the NetClassServerImpl is active.
Specified by:
isActive in interface ActivatableIf

getClassVersion

public java.lang.String getClassVersion()
Returns the version of this class.

getClassPaths

public java.util.Vector getClassPaths()
                               throws java.rmi.RemoteException
Returns the class path currently used by the network class and library server.
Specified by:
getClassPaths in interface NetClassServer
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.

setClassPaths

public void setClassPaths(java.util.Vector newValue)
                   throws java.rmi.RemoteException
Sets the class path to be used by the network class and library server.
Specified by:
setClassPaths in interface NetClassServer
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.

getLibPaths

public java.util.Vector getLibPaths()
                             throws java.rmi.RemoteException
Returns the library path currently used by the network class and library server.
Specified by:
getLibPaths in interface NetClassServer
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.

setLibPaths

public void setLibPaths(java.util.Vector newValue)
                 throws java.rmi.RemoteException
Sets the library path to be used by the network class and library server.
Specified by:
setLibPaths in interface NetClassServer
Throws:
java.rmi.RemoteException - See java.rmi.RemoteException.

getName

public ObjectName getName()

getServiceName

public java.lang.String getServiceName()