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

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

public class MLet
extends java.lang.Object
implements java.io.Serializable

This class represents the contents of the MLET tag.

The MLET tag has the following syntax:

<MLET
CODE = class | OBJECT = serfile
ARCHIVE = "archiveList"
[CODEBASE = codebaseURL]
[NAME = mbeanname]
[PERSISTENT = true | false]
[VERSION = version]
>
[paramlist]
</MLET>

where:

CODE = class
This attribute specifies the full Java class name, including package name, of the m-bean to be obtained. The compiled .class file of the m-bean must be contained in one of the .jar files specified by the ARCHIVE attribute. Either CODE or OBJECT must be present.
OBJECT = serfile
This attribute specifies the .ser file that contains a serialized representation of the m-bean to be obtained. This file must be contained in one of the .jar files specified by the ARCHIVE attribute. If the .jar file contains a directory hierarchy, specify the path of the file within this hierarchy. Otherwise a match will not be found. Either CODE or OBJECT must be present.
ARCHIVE = "archiveList"
This mandatory attribute specifies one or more .jar files containing m-beans or other resources used by the m-bean to be obtained. One of the .jar files must contain the file specified by the CODE or OBJECT attribute. If archivelist contains more than one file: All .jar files in archivelist must be stored in the directory specified by the code base URL.
CODEBASE = codebaseURL
This optional attribute specifies the code base URL of the m-bean to be obtained. It identifies the directory that contains the .jar files specified by the ARCHIVE attribute. Specify this attribute only if the .jar files are not in the same directory as the m-let text file. If this attribute is not specified, the base URL of the m-let text file is used.
NAME = mbeanname
This optional attribute specifies the object name to be assigned to the m-bean instance when the m-let service registers it. If mbeanname starts with the colon character (:), the domain part of the object name is the domain of the agent. The m-let service invokes the getDomain() method of the Framework class to obtain this information.
PERSISTENT = true | false
This optional attribute specifies the persistency or not persistency of the m-bean instance when the m-let service registers it.
VERSION = version
This optional attribute specifies the version number of the m-bean and associated .jar files to be obtained. This version number can be used to specify that the .jar files are loaded from the server to update those stored locally in the cache the next time the m-let text file is loaded. version must be a series of non-negative decimal integers each separated by a period from the one that precedes it.
paramlist
This optional attribute specifies a list of one or more parameters for the m-bean to be instantiated. This list is passed as a modification list to the initCmf method of the m-bean to be instantiated. Each parameter in paramlist corresponds to a modification in the modification list. Use the following syntax to specify each item in paramlist:

<PARAM NAME=propertyName VALUE=value>

where:

The m-let service passes all the values in the modification list as String objects. You have to ensure that the initCmf method of the m-bean includes the code required to cast each String object into an instance of the appropriate type. For example, if the property is an integer, you have to cast the String object passed by the m-let service into an int.

Note - Multiple MLET tags with the same code base URL share the same instance of the MLetClassLoader class.

See Also:
Serialized Form

Constructor Summary
MLet(java.net.URL url, java.util.Hashtable attributes)
          Creates an MLet instance initialized with attributes read from an MLET tag in an m-let text file.
 
Method Summary
 java.util.Hashtable getAttributes()
          Gets the attributes of the MLET tag.
static java.lang.String getClassVersion()
          Gets the version of this class.
 java.lang.String getCode()
          Gets the value of the CODE attribute of the MLET tag.
 java.net.URL getCodeBase()
          Gets the code base URL.
 java.net.URL getDocumentBase()
          Gets the m-let text file's base URL.
 java.lang.String getJarFiles()
          Gets the list of .jar files specified by the ARCHIVE attribute of the MLET tag.
 java.lang.String getName()
          Gets the value of the NAME attribute of the MLET tag.
 java.lang.String getParameter(java.lang.String name)
          Gets the value of the specified attribute of the MLET tag.
 boolean getPersistent()
          Gets the value of the PERSISTENT attribute of the MLET tag.
 java.lang.String getSerializedObject()
          Gets the value of the OBJECT attribute of the MLET tag.
 java.lang.String getVersion()
          Gets the value of the VERSION attribute of the MLET tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MLet

public MLet(java.net.URL url,
            java.util.Hashtable attributes)
Creates an MLet instance initialized with attributes read from an MLET tag in an m-let text file.
Parameters:
url - The URL of the m-let text file containing the MLET tag.
attributes - A list of the attributes of the MLET tag.
Method Detail

getAttributes

public java.util.Hashtable getAttributes()
Gets the attributes of the MLET tag.
Returns:
A hash table of the attributes of the MLET tag and their values.

getDocumentBase

public java.net.URL getDocumentBase()
Gets the m-let text file's base URL.
Returns:
The m-let text file's base URL.

getCodeBase

public java.net.URL getCodeBase()
Gets the code base URL.
Returns:
The code base URL.

getJarFiles

public java.lang.String getJarFiles()
Gets the list of .jar files specified by the ARCHIVE attribute of the MLET tag.
Returns:
A comma-separated list of .jar file names.

getCode

public java.lang.String getCode()
Gets the value of the CODE attribute of the MLET tag.
Returns:
The value of the CODE attribute of the MLET tag.

getSerializedObject

public java.lang.String getSerializedObject()
Gets the value of the OBJECT attribute of the MLET tag.
Returns:
The value of the OBJECT attribute of the MLET tag.

getName

public java.lang.String getName()
Gets the value of the NAME attribute of the MLET tag.
Returns:
The value of the NAME attribute of the MLET tag.

getPersistent

public boolean getPersistent()
Gets the value of the PERSISTENT attribute of the MLET tag.
Returns:
The value of the PERSISTENT attribute of the MLET tag.

getVersion

public java.lang.String getVersion()
Gets the value of the VERSION attribute of the MLET tag.
Returns:
The value of the VERSION attribute of the MLET tag.

getParameter

public java.lang.String getParameter(java.lang.String name)
Gets the value of the specified attribute of the MLET tag.
Parameters:
name - A string representing the name of the attribute.
Returns:
The value of the specified attribute of the MLET tag.

getClassVersion

public static java.lang.String getClassVersion()
Gets the version of this class.
Returns:
The version of this class.