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:
- The system - from the location defined by the
CLASSPATH
environment variable
.jar files
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:
- defaultDomain is the domain associated with the core
management framework.
- JavaClass is the full Java class name, including the package
prefix, of the class loader used to create the m-bean. This is defined as
the Java variable
ServiceName.MLETLOADER.
- baseURL specifies the location of the code of the m-bean.
It is either the base URL of the text file specified in the call to one of
the load URL methods of the m-let service,
or is the
CODEBASE attribute specified in the
MLET tag.
-
MLetClassLoader()
- Instantiates the m-let class loader.
-
MLetClassLoader(URL)
- Instantiates the m-let class loader with a specified codebase.
-
deleteCmf()
- Deletes the m-let class loader.
-
getClassVersion()
- Gets the version of this class.
-
getCodeBase()
- Gets the code base of this instance of
MLetClassLoader.
-
getLoaderName()
- Gets the object name of this instance of
MLetClassLoader.
-
getResource(String)
- Gets the URL of a desired resource.
-
getResourceAsStream(String)
- Gets an input stream for the desired resource.
-
getURLConnectionResource(String, String)
- Gets the local resource object through the
MLetURLConnection.
-
getURLConnectionResourceAsStream(String, String)
- Gets the local resource object as an input stream through the
MLetURLConnection.
-
initCmf(Framework, ObjectName, boolean, ModificationList)
- Initializes the m-let class loader.
-
loadClass(String)
- Loads a class from this class loader.
-
loadLibrary(String, String)
- Loads a dynamic native library.
-
loadSerializedObject(URL, String)
- Loads the serialized object specified by the
OBJECT
attribute of the MLET tag.
-
readExternal(ObjectInput)
- This method reads the objects contents during Object Serialization.
-
setClassDefinition(String, byte[], int, int)
- Sets some bytecodes as a definition for a class.
-
setResourceDefinition(String, byte[], String)
- Sets some bytes as a definition of a resource.
-
writeExternal(ObjectOutput)
- This method saves the objects contents during Object Serialization.
MLetClassLoader
public MLetClassLoader()
- Instantiates the m-let class loader.
MLetClassLoader
public MLetClassLoader(URL codebase)
- Instantiates the m-let class loader with a specified codebase.
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.
deleteCmf
public void deleteCmf()
- Deletes the m-let class loader.
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.
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
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.
setResourceDefinition
public void setResourceDefinition(String name,
byte data[],
String type)
- Sets some bytes as a definition of a resource.
getResource
public URL getResource(String name)
- Gets the URL of a desired resource.
- Returns:
- The URL of the resource.
- Overrides:
- getResource in class ClassLoader
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
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.
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.
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.
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.
getClassVersion
public static String getClassVersion()
- Gets the version of this class.
- Returns:
- the version of this class.
getCodeBase
public URL getCodeBase()
- Gets the code base of this instance of
MLetClassLoader.
- Returns:
- The code base of this instance of
MLetClassLoader.
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