All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.jaw.impl.agent.services.mlet.MLetClassLoader

java.lang.Object
   |
   +----java.lang.ClassLoader
           |
           +----com.sun.jaw.impl.agent.services.mlet.MLetClassLoader

public class MLetClassLoader
extends ClassLoader
implements LibraryLoaderIf, Externalizable
This class represents the class loader that the m-let service uses to load classes and resources.

This class loader can load classes and resources from:

Note - Do not instantiate this class explicitly. The m-let service instantiates this class each time a load URL method is invoked.

When it instantiates this class, the m-let service registers the instance with the repository. This enables a client application to instantiate an m-bean loaded through this class loader by specifying its object name.

The class loader created is registered with an object name of the form:

defaultDomain:JavaClass.codebase=baseURL

where:


Constructor Index

 o MLetClassLoader()
Instantiates the m-let class loader.
 o MLetClassLoader(URL)
Instantiates the m-let class loader with a specified codebase.

Method Index

 o deleteCmf()
Deletes the m-let class loader.
 o getClassVersion()
Gets the version of this class.
 o getCodeBase()
Gets the code base of this instance of MLetClassLoader.
 o getLoaderName()
Gets the object name of this instance of MLetClassLoader.
 o getResource(String)
Gets the URL of a desired resource.
 o getResourceAsStream(String)
Gets an input stream for the desired resource.
 o getURLConnectionResource(String, String)
Gets the local resource object through the MLetURLConnection.
 o getURLConnectionResourceAsStream(String, String)
Gets the local resource object as an input stream through the MLetURLConnection.
 o initCmf(Framework, ObjectName, boolean, ModificationList)
Initializes the m-let class loader.
 o loadClass(String)
Loads a class from this class loader.
 o loadLibrary(String, String)
Loads a dynamic native library.
 o loadSerializedObject(URL, String)
Loads the serialized object specified by the OBJECT attribute of the MLET tag.
 o readExternal(ObjectInput)
This method reads the objects contents during Object Serialization.
 o setClassDefinition(String, byte[], int, int)
Sets some bytecodes as a definition for a class.
 o setResourceDefinition(String, byte[], String)
Sets some bytes as a definition of a resource.
 o writeExternal(ObjectOutput)
This method saves the objects contents during Object Serialization.

Constructors

 o MLetClassLoader
 public MLetClassLoader()
Instantiates the m-let class loader.

 o MLetClassLoader
 public MLetClassLoader(URL codebase)
Instantiates the m-let class loader with a specified codebase.

Methods

 o initCmf
 public void initCmf(Framework cmf,
                     ObjectName name,
                     boolean db,
                     ModificationList list) throws IllegalAccessException, InstanceAlreadyExistException
Initializes the m-let class loader. The method registers the m-let class loader with the core management framework.
For internal use only.

Parameters:
cmf - 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: IllegalAccessException
The method cannot access the class definition of the m-let class loader.
Throws: InstanceAlreadyExistException
The m-let class loader is already registered.
 o deleteCmf
 public void deleteCmf()
Deletes the m-let class loader.

 o setClassDefinition
 public MLetClassEntry setClassDefinition(String name,
                                          byte classbuf[],
                                          int start,
                                          int len)
Sets some bytecodes as a definition for a class. The class is not actually defined until later.

 o loadClass
 public Class loadClass(String name) throws ClassNotFoundException
Loads a class from this class loader.

Throws: ClassNotFoundException
The specified class could not be found.
Overrides:
loadClass in class ClassLoader
 o loadSerializedObject
 public Object loadSerializedObject(URL codebase,
                                    String filename) throws IOException, ClassNotFoundException
Loads the serialized object specified by the OBJECT attribute of the MLET tag.

Throws: ClassNotFoundException
The specified serialized object could not be found.
Throws: IOException
An I/O error occurred while loading serialized object.
 o setResourceDefinition
 public void setResourceDefinition(String name,
                                   byte data[],
                                   String type)
Sets some bytes as a definition of a resource.

 o getResource
 public URL getResource(String name)
Gets the URL of a desired resource.

Returns:
The URL of the resource.
Overrides:
getResource in class ClassLoader
 o getResourceAsStream
 public InputStream getResourceAsStream(String name)
Gets an input stream for the desired resource.

Returns:
an input stream for the desired resource.
Overrides:
getResourceAsStream in class ClassLoader
 o getURLConnectionResource
 public static synchronized Object getURLConnectionResource(String base,
                                                            String name) throws IOException
Gets the local resource object through the MLetURLConnection.

Returns:
The local resource object.
Throws: IOException
Signals that an I/O exception of some sort has occurred.
 o getURLConnectionResourceAsStream
 public static synchronized InputStream getURLConnectionResourceAsStream(String base,
                                                                         String name) throws IOException
Gets the local resource object as an input stream through the MLetURLConnection.

Returns:
An inputs stream representing the required resource.
Throws: IOException
Signals that an I/O exception of some sort has occurred.
 o 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 (jar file).
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.
 o 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.
 o 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.
 o getClassVersion
 public static String getClassVersion()
Gets the version of this class.

Returns:
the version of this class.
 o getCodeBase
 public URL getCodeBase()
Gets the code base of this instance of MLetClassLoader.

Returns:
The code base of this instance of MLetClassLoader.
 o getLoaderName
 public ObjectName getLoaderName()
Gets the object name of this instance of MLetClassLoader.

Returns:
The object name of this instance of MLetClassLoader.

All Packages  Class Hierarchy  This Package  Previous  Next  Index