All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.jaw.impl.agent.services.loader.rmi.NetClassLoader
java.lang.Object
|
+----java.lang.ClassLoader
|
+----com.sun.jaw.impl.agent.services.loader.rmi.NetClassLoader
- public class NetClassLoader
- extends ClassLoader
- implements LibraryLoaderIf, Externalizable, ActivatableIf
This class provides a simple implementation of a class loader which will
load a class from a Class Server based on RMI.
The class loader can be instantiated at start time in the agent or
dynamically. Several instances of the NetClassLoader can co-exist within the
same agent.
When initializing the class loader, an object name must be assigned to the
instance. The object name is used by the class loader for retrieving
configuration information. So the following key properties need to be
specified in the object name:
- host: The hostname where the class server is running. By default this is the local host.
- port: The port number to use. By default this is
1099.
- service: The service name of the RMI object acting as server. By default this is
NetClassServer.
- secure:
true, the classloader loads only classes signed by a trusted signer.
false, the classloader loads any class signed/not-signed by a trusted/not-trusted signer.
By default this is false.
- See Also:
- NetClassServerImpl
-
NetClassLoader()
- Default constructor.
-
NetClassLoader(ObjectName)
- Initialize the NetClassLoader service.
-
deleteCmf()
- Deletes the net class loader.
-
getClassVersion()
- Returns the version of this class.
-
getLibPaths()
- Returns the current libpath used by the loader for
storing native libraries
-
getLoaderName()
- Gets the object name of this instance of
NetClassLoader.
-
initCmf(Framework, ObjectName, boolean, ModificationList)
- Initialize the NetClassLoader service.
-
isActive()
- Tests if the
NetClassLoader is active.
-
loadClass(String)
-
-
loadLibrary(String, String)
- Loads a dynamic native library.
-
performStart()
- Activates the
NetClassLoader.
-
performStop()
- Deactivates the
NetClassLoader.
-
readExternal(ObjectInput)
- This method reads the objects contents during Object Serialization.
-
setLibPaths(Vector)
- Set library path from where native libraries are loaded
-
writeExternal(ObjectOutput)
- This method saves the objects contents during Object Serialization.
NetClassLoader
public NetClassLoader()
- Default constructor.
NetClassLoader
public NetClassLoader(ObjectName name)
- Initialize the NetClassLoader service.
- Parameters:
- name - Object name containing configuration infotmation.
initCmf
public void initCmf(Framework cmf,
ObjectName name,
boolean db,
ModificationList list) throws InstanceAlreadyExistException
- Initialize the NetClassLoader service.
The method will declare the object to the Core Management Framework.
The name of the class server as well as host/port information are
contained in the object name.
For internal use only.
- Parameters:
- agent - The core management framework to register the service with.
- name - Object name containing configuration information.
- 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.
deleteCmf
public void deleteCmf()
- Deletes the net class loader.
loadLibrary
public void loadLibrary(String baseName,
String libName) throws SecurityException, UnsatisfiedLinkError
- Loads a dynamic native library.
- Parameters:
- basename - The basename argument is the unique library base name where the
library is stored on the management server.
- libname - The libname argument is either the full pathname of the library
below the library base path or is a simple, architecture-independent
library name where the path, prefix, and suffix for the library name
are generated based on the appliance type on which the loadLibrary()
call was made.
- Throws: SecurityException
- If the current thread cannot load the specified dynamic library.
- Throws: UnsatisfiedLinkError
- If the library does not exist.
loadClass
public Class loadClass(String name) throws ClassNotFoundException
- Throws: ClassNotFoundException
- The specified class could not be found.
- Overrides:
- loadClass in class ClassLoader
performStart
public synchronized void performStart()
- Activates the
NetClassLoader.
performStop
public synchronized void performStop()
- Deactivates the
NetClassLoader.
isActive
public boolean isActive()
- Tests if the
NetClassLoader is active.
getClassVersion
public static String getClassVersion()
- Returns the version of this class.
getLoaderName
public ObjectName getLoaderName()
- Gets the object name of this instance of
NetClassLoader.
- Returns:
- The object name of this instance of
NetClassLoader.
getLibPaths
public Vector getLibPaths()
- Returns the current libpath used by the loader for
storing native libraries
setLibPaths
public void setLibPaths(Vector newValue) throws RemoteException
- Set library path from where native libraries are loaded
- Throws: RemoteException
- See java.rmi.RemoteException.
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- This method saves the objects contents during Object Serialization.
- Parameters:
- out - The serialization output stream.
- Throws: IOException
- Signals that an I/O exception of some sort has occurred.
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- This method reads the objects contents during Object Serialization.
- Parameters:
- in - The serialization input stream.
- Throws: IOException
- Signals that an I/O exception of some sort has occurred.
- Throws: ClassNotFoundException
- The class for an object being restored cannot be found.
All Packages Class Hierarchy This Package Previous Next Index