FileDocCategorySizeDatePackage
MLetContent.javaAPI DocJava SE 5 API9271Fri Aug 26 14:57:34 BST 2005javax.management.loading

MLetContent

public class MLetContent extends Object
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]
[VERSION = version]
>
[arglist]
</MLET>

where:

CODE = class
This attribute specifies the full Java class name, including package name, of the MBean to be obtained. The compiled .class file of the MBean 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 MBean 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 MBeans or other resources used by the MBean 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:
  • Each file must be separated from the one that follows it by a comma (,).
  • archivelist must be enclosed in double quote marks.
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 MBean 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 MLet text file. If this attribute is not specified, the base URL of the MLet text file is used.
NAME = mbeanname
This optional attribute specifies the object name to be assigned to the MBean instance when the MLet service registers it. If mbeanname starts with the colon character (:), the domain part of the object name is the domain of the agent. The MLet 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 MBean instance when the MLet service registers it.
VERSION = version
This optional attribute specifies the version number of the MBean 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 MLet 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 MBean 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:
  • propertyName is the name of the property in the modification
  • value is the value in the modification

The MLet service passes all the values in the modification list as String objects.

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

version
3.3 02/08/99
author
Sun Microsystems, Inc
since
1.5

Fields Summary
private Map
attributes
A hash table of the attributes of the MLET tag and their values.
private URL
documentURL
The MLet text file's base URL.
private URL
baseURL
The base URL.
Constructors Summary
public MLetContent(URL url, Map attributes)
Creates an MLet instance initialized with attributes read from an MLET tag in an MLet text file.

param
url The URL of the MLet text file containing the MLET tag.
param
attributes A list of the attributes of the MLET tag.

	this.documentURL = url;
	this.attributes = attributes;

	// Initialize baseURL
	//
	String att = (String)getParameter("codebase");
	if (att != null) {
	    if (!att.endsWith("/")) {
		att += "/";
	    }
	    try {
		baseURL = new URL(documentURL, att);
	    } catch (MalformedURLException e) {
		// OK : Move to next block as baseURL could not be initialized.
	    }
	}
	if (baseURL == null) {
	    String file = documentURL.getFile();
	    int i = file.lastIndexOf('/");
	    if (i > 0 && i < file.length() - 1) {
		try {
		    baseURL = new URL(documentURL, file.substring(0, i + 1));
		} catch (MalformedURLException e) {
		    // OK : Move to next block as baseURL could not be initialized.
		}
	    }
	}
	if (baseURL == null)
	    baseURL = documentURL;

    
Methods Summary
public java.util.MapgetAttributes()
Gets the attributes of the MLET tag.

return
A hash table of the attributes of the MLET tag and their values.

	return attributes;
    
public java.lang.StringgetCode()
Gets the value of the CODE attribute of the MLET tag.

return
The value of the CODE attribute of the MLET tag.

	return (String)getParameter("code");
    
public java.net.URLgetCodeBase()
Gets the code base URL.

return
The code base URL.

	return baseURL;
    
public java.net.URLgetDocumentBase()
Gets the MLet text file's base URL.

return
The MLet text file's base URL.

	return documentURL;
    
public java.lang.StringgetJarFiles()
Gets the list of .jar files specified by the ARCHIVE attribute of the MLET tag.

return
A comma-separated list of .jar file names.

	return (String)getParameter("archive");
    
public java.lang.StringgetName()
Gets the value of the NAME attribute of the MLET tag.

return
The value of the NAME attribute of the MLET tag.

	return (String)getParameter("name");
    
public java.lang.ObjectgetParameter(java.lang.String name)
Gets the value of the specified attribute of the MLET tag.

param
name A string representing the name of the attribute.
return
The value of the specified attribute of the MLET tag.

	return (Object) attributes.get(name.toLowerCase());
    
public java.lang.StringgetSerializedObject()
Gets the value of the OBJECT attribute of the MLET tag.

return
The value of the OBJECT attribute of the MLET tag.

	return (String)getParameter("object");
    
public java.lang.StringgetVersion()
Gets the value of the VERSION attribute of the MLET tag.

return
The value of the VERSION attribute of the MLET tag.

	return (String)getParameter("version");