javax.management.loading
Class MLet

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader 
      extended by java.security.SecureClassLoader sample code for java.security.SecureClassLoader definition code for java.security.SecureClassLoader 
          extended by java.net.URLClassLoader sample code for java.net.URLClassLoader definition code for java.net.URLClassLoader 
              extended by javax.management.loading.MLet
All Implemented Interfaces:
Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean , MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Direct Known Subclasses:
PrivateMLet sample code for javax.management.loading.PrivateMLet definition code for javax.management.loading.PrivateMLet

public class MLet
extends URLClassLoader sample code for java.net.URLClassLoader definition code for java.net.URLClassLoader
implements MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean , MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration , Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable

Allows you to instantiate and register one or several MBeans in the MBean server coming from a remote URL. M-let is a shortcut for management applet. The m-let service does this by loading an m-let text file, which specifies information on the MBeans to be obtained. The information on each MBean is specified in a single instance of a tag, called the MLET tag. The location of the m-let text file is specified by a URL.

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: 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 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 MBean 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.
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 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.
arglist
This optional attribute specifies a list of one or more parameters for the MBean to be instantiated. This list describes the parameters to be passed the MBean's constructor. Use the following syntax to specify each item in arglist:

<ARG TYPE=argumentType VALUE=value>

where:

The arguments' type in the argument list should be a Java primitive type or a Java basic type (java.lang.Boolean, java.lang.Byte, java.lang.Short, java.lang.Long, java.lang.Integer, java.lang.Float, java.lang.Double, java.lang.String).

When an m-let text file is loaded, an instance of each MBean specified in the file is created and registered.

The m-let Service extends the java.net.URLClassLoader and can be used to load remote classes and jar files in the VM of the agent.

Note - The MLet class loader uses the MBeanServerFactory.getClassLoaderRepository(javax.management.MBeanServer) sample code for javax.management.MBeanServerFactory.getClassLoaderRepository(javax.management.MBeanServer) definition code for javax.management.MBeanServerFactory.getClassLoaderRepository(javax.management.MBeanServer) to load classes that could not be found in the loaded jar files.

Since:
1.5
See Also:
Serialized Form

Constructor Summary
MLet sample code for javax.management.loading.MLet.MLet() definition code for javax.management.loading.MLet.MLet() ()
          Constructs a new MLet using the default delegation parent ClassLoader.
MLet sample code for javax.management.loading.MLet.MLet(java.net.URL[]) definition code for javax.management.loading.MLet.MLet(java.net.URL[]) (URL sample code for java.net.URL definition code for java.net.URL [] urls)
          Constructs a new MLet for the specified URLs using the default delegation parent ClassLoader.
MLet sample code for javax.management.loading.MLet.MLet(java.net.URL[], boolean) definition code for javax.management.loading.MLet.MLet(java.net.URL[], boolean) (URL sample code for java.net.URL definition code for java.net.URL [] urls, boolean delegateToCLR)
          Constructs a new MLet for the specified URLs using the default delegation parent ClassLoader.
MLet sample code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader) definition code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader) (URL sample code for java.net.URL definition code for java.net.URL [] urls, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent)
          Constructs a new MLet for the given URLs.
MLet sample code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader, boolean) definition code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader, boolean) (URL sample code for java.net.URL definition code for java.net.URL [] urls, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent, boolean delegateToCLR)
          Constructs a new MLet for the given URLs.
MLet sample code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory) definition code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory) (URL sample code for java.net.URL definition code for java.net.URL [] urls, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent, URLStreamHandlerFactory sample code for java.net.URLStreamHandlerFactory definition code for java.net.URLStreamHandlerFactory  factory)
          Constructs a new MLet for the specified URLs, parent class loader, and URLStreamHandlerFactory.
MLet sample code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory, boolean) definition code for javax.management.loading.MLet.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory, boolean) (URL sample code for java.net.URL definition code for java.net.URL [] urls, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent, URLStreamHandlerFactory sample code for java.net.URLStreamHandlerFactory definition code for java.net.URLStreamHandlerFactory  factory, boolean delegateToCLR)
          Constructs a new MLet for the specified URLs, parent class loader, and URLStreamHandlerFactory.
 
Method Summary
 void addURL sample code for javax.management.loading.MLet.addURL(java.lang.String) definition code for javax.management.loading.MLet.addURL(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  url)
          Appends the specified URL to the list of URLs to search for classes and resources.
 void addURL sample code for javax.management.loading.MLet.addURL(java.net.URL) definition code for javax.management.loading.MLet.addURL(java.net.URL) (URL sample code for java.net.URL definition code for java.net.URL  url)
          Appends the specified URL to the list of URLs to search for classes and resources.
protected  URL sample code for java.net.URL definition code for java.net.URL check sample code for javax.management.loading.MLet.check(java.lang.String, java.net.URL, java.lang.String, javax.management.loading.MLetContent) definition code for javax.management.loading.MLet.check(java.lang.String, java.net.URL, java.lang.String, javax.management.loading.MLetContent) (String sample code for java.lang.String definition code for java.lang.String  version, URL sample code for java.net.URL definition code for java.net.URL  codebase, String sample code for java.lang.String definition code for java.lang.String  jarfile, javax.management.loading.MLetContent mlet)
          This method is to be overridden when extending this service to support caching and versioning.
protected  Class sample code for java.lang.Class definition code for java.lang.Class findClass sample code for javax.management.loading.MLet.findClass(java.lang.String) definition code for javax.management.loading.MLet.findClass(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          This is the main method for class loaders that is being redefined.
protected  String sample code for java.lang.String definition code for java.lang.String findLibrary sample code for javax.management.loading.MLet.findLibrary(java.lang.String) definition code for javax.management.loading.MLet.findLibrary(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  libname)
          Returns the absolute path name of a native library.
 String sample code for java.lang.String definition code for java.lang.String getLibraryDirectory sample code for javax.management.loading.MLet.getLibraryDirectory() definition code for javax.management.loading.MLet.getLibraryDirectory() ()
          Gets the current directory used by the library loader for storing native libraries before they are loaded into memory.
 Set sample code for java.util.Set definition code for java.util.Set getMBeansFromURL sample code for javax.management.loading.MLet.getMBeansFromURL(java.lang.String) definition code for javax.management.loading.MLet.getMBeansFromURL(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  url)
          Loads a text file containing MLET tags that define the MBeans to be added to the agent.
 Set sample code for java.util.Set definition code for java.util.Set getMBeansFromURL sample code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL) definition code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL) (URL sample code for java.net.URL definition code for java.net.URL  url)
          Loads a text file containing MLET tags that define the MBeans to be added to the agent.
 URL sample code for java.net.URL definition code for java.net.URL [] getURLs sample code for javax.management.loading.MLet.getURLs() definition code for javax.management.loading.MLet.getURLs() ()
          Returns the search path of URLs for loading classes and resources.
 Class sample code for java.lang.Class definition code for java.lang.Class loadClass sample code for javax.management.loading.MLet.loadClass(java.lang.String, javax.management.loading.ClassLoaderRepository) definition code for javax.management.loading.MLet.loadClass(java.lang.String, javax.management.loading.ClassLoaderRepository) (String sample code for java.lang.String definition code for java.lang.String  name, ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository  clr)
          Load a class, using the given ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository if the class is not found in this MLet's URLs.
 void postDeregister sample code for javax.management.loading.MLet.postDeregister() definition code for javax.management.loading.MLet.postDeregister() ()
          Allows the m-let to perform any operations needed after having been unregistered in the MBean server.
 void postRegister sample code for javax.management.loading.MLet.postRegister(java.lang.Boolean) definition code for javax.management.loading.MLet.postRegister(java.lang.Boolean) (Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  registrationDone)
          Allows the m-let to perform any operations needed after having been registered in the MBean server or after the registration has failed.
 void preDeregister sample code for javax.management.loading.MLet.preDeregister() definition code for javax.management.loading.MLet.preDeregister() ()
          Allows the m-let to perform any operations it needs before being unregistered by the MBean server.
 ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName preRegister sample code for javax.management.loading.MLet.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.loading.MLet.preRegister(javax.management.MBeanServer, javax.management.ObjectName) (MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  server, ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
          Allows the m-let to perform any operations it needs before being registered in the MBean server.
 void readExternal sample code for javax.management.loading.MLet.readExternal(java.io.ObjectInput) definition code for javax.management.loading.MLet.readExternal(java.io.ObjectInput) (ObjectInput sample code for java.io.ObjectInput definition code for java.io.ObjectInput  in)
          Restore this MLet's contents from the given ObjectInput sample code for java.io.ObjectInput definition code for java.io.ObjectInput .
 void setLibraryDirectory sample code for javax.management.loading.MLet.setLibraryDirectory(java.lang.String) definition code for javax.management.loading.MLet.setLibraryDirectory(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  libdir)
          Sets the directory used by the library loader for storing native libraries before they are loaded into memory.
 void writeExternal sample code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput) definition code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput) (ObjectOutput sample code for java.io.ObjectOutput definition code for java.io.ObjectOutput  out)
          Save this MLet's contents to the given ObjectOutput sample code for java.io.ObjectOutput definition code for java.io.ObjectOutput .
 
Methods inherited from class java.net.URLClassLoader sample code for java.net.URLClassLoader definition code for java.net.URLClassLoader
definePackage sample code for java.net.URLClassLoader.definePackage(java.lang.String, java.util.jar.Manifest, java.net.URL) definition code for java.net.URLClassLoader.definePackage(java.lang.String, java.util.jar.Manifest, java.net.URL) , findResource sample code for java.net.URLClassLoader.findResource(java.lang.String) definition code for java.net.URLClassLoader.findResource(java.lang.String) , findResources sample code for java.net.URLClassLoader.findResources(java.lang.String) definition code for java.net.URLClassLoader.findResources(java.lang.String) , getPermissions sample code for java.net.URLClassLoader.getPermissions(java.security.CodeSource) definition code for java.net.URLClassLoader.getPermissions(java.security.CodeSource) , newInstance sample code for java.net.URLClassLoader.newInstance(java.net.URL[]) definition code for java.net.URLClassLoader.newInstance(java.net.URL[]) , newInstance sample code for java.net.URLClassLoader.newInstance(java.net.URL[], java.lang.ClassLoader) definition code for java.net.URLClassLoader.newInstance(java.net.URL[], java.lang.ClassLoader)
 
Methods inherited from class java.security.SecureClassLoader sample code for java.security.SecureClassLoader definition code for java.security.SecureClassLoader
defineClass sample code for java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) definition code for java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) , defineClass sample code for java.security.SecureClassLoader.defineClass(java.lang.String, java.nio.ByteBuffer, java.security.CodeSource) definition code for java.security.SecureClassLoader.defineClass(java.lang.String, java.nio.ByteBuffer, java.security.CodeSource)
 
Methods inherited from class java.lang.ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader
clearAssertionStatus sample code for java.lang.ClassLoader.clearAssertionStatus() definition code for java.lang.ClassLoader.clearAssertionStatus() , defineClass sample code for java.lang.ClassLoader.defineClass(byte[], int, int) definition code for java.lang.ClassLoader.defineClass(byte[], int, int) , defineClass sample code for java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int) definition code for java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int) , defineClass sample code for java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) definition code for java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) , defineClass sample code for java.lang.ClassLoader.defineClass(java.lang.String, java.nio.ByteBuffer, java.security.ProtectionDomain) definition code for java.lang.ClassLoader.defineClass(java.lang.String, java.nio.ByteBuffer, java.security.ProtectionDomain) , definePackage sample code for java.lang.ClassLoader.definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.net.URL) definition code for java.lang.ClassLoader.definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.net.URL) , findLoadedClass sample code for java.lang.ClassLoader.findLoadedClass(java.lang.String) definition code for java.lang.ClassLoader.findLoadedClass(java.lang.String) , findSystemClass sample code for java.lang.ClassLoader.findSystemClass(java.lang.String) definition code for java.lang.ClassLoader.findSystemClass(java.lang.String) , getPackage sample code for java.lang.ClassLoader.getPackage(java.lang.String) definition code for java.lang.ClassLoader.getPackage(java.lang.String) , getPackages sample code for java.lang.ClassLoader.getPackages() definition code for java.lang.ClassLoader.getPackages() , getParent sample code for java.lang.ClassLoader.getParent() definition code for java.lang.ClassLoader.getParent() , getResource sample code for java.lang.ClassLoader.getResource(java.lang.String) definition code for java.lang.ClassLoader.getResource(java.lang.String) , getResourceAsStream sample code for java.lang.ClassLoader.getResourceAsStream(java.lang.String) definition code for java.lang.ClassLoader.getResourceAsStream(java.lang.String) , getResources sample code for java.lang.ClassLoader.getResources(java.lang.String) definition code for java.lang.ClassLoader.getResources(java.lang.String) , getSystemClassLoader sample code for java.lang.ClassLoader.getSystemClassLoader() definition code for java.lang.ClassLoader.getSystemClassLoader() , getSystemResource sample code for java.lang.ClassLoader.getSystemResource(java.lang.String) definition code for java.lang.ClassLoader.getSystemResource(java.lang.String) , getSystemResourceAsStream sample code for java.lang.ClassLoader.getSystemResourceAsStream(java.lang.String) definition code for java.lang.ClassLoader.getSystemResourceAsStream(java.lang.String) , getSystemResources sample code for java.lang.ClassLoader.getSystemResources(java.lang.String) definition code for java.lang.ClassLoader.getSystemResources(java.lang.String) , loadClass sample code for java.lang.ClassLoader.loadClass(java.lang.String) definition code for java.lang.ClassLoader.loadClass(java.lang.String) , loadClass sample code for java.lang.ClassLoader.loadClass(java.lang.String, boolean) definition code for java.lang.ClassLoader.loadClass(java.lang.String, boolean) , resolveClass sample code for java.lang.ClassLoader.resolveClass(java.lang.Class) definition code for java.lang.ClassLoader.resolveClass(java.lang.Class) , setClassAssertionStatus sample code for java.lang.ClassLoader.setClassAssertionStatus(java.lang.String, boolean) definition code for java.lang.ClassLoader.setClassAssertionStatus(java.lang.String, boolean) , setDefaultAssertionStatus sample code for java.lang.ClassLoader.setDefaultAssertionStatus(boolean) definition code for java.lang.ClassLoader.setDefaultAssertionStatus(boolean) , setPackageAssertionStatus sample code for java.lang.ClassLoader.setPackageAssertionStatus(java.lang.String, boolean) definition code for java.lang.ClassLoader.setPackageAssertionStatus(java.lang.String, boolean) , setSigners sample code for java.lang.ClassLoader.setSigners(java.lang.Class, java.lang.Object[]) definition code for java.lang.ClassLoader.setSigners(java.lang.Class, java.lang.Object[])
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 
Methods inherited from interface javax.management.loading.MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
getResource sample code for javax.management.loading.MLetMBean.getResource(java.lang.String) definition code for javax.management.loading.MLetMBean.getResource(java.lang.String) , getResourceAsStream sample code for javax.management.loading.MLetMBean.getResourceAsStream(java.lang.String) definition code for javax.management.loading.MLetMBean.getResourceAsStream(java.lang.String) , getResources sample code for javax.management.loading.MLetMBean.getResources(java.lang.String) definition code for javax.management.loading.MLetMBean.getResources(java.lang.String)
 

Constructor Detail

MLet sample code for javax.management.loading.MLet() definition code for javax.management.loading.MLet()

public MLet()
Constructs a new MLet using the default delegation parent ClassLoader.


MLet sample code for javax.management.loading.MLet(java.net.URL[]) definition code for javax.management.loading.MLet(java.net.URL[])

public MLet(URL sample code for java.net.URL definition code for java.net.URL [] urls)
Constructs a new MLet for the specified URLs using the default delegation parent ClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the parent class loader.

Parameters:
urls - The URLs from which to load classes and resources.

MLet sample code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader) definition code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader)

public MLet(URL sample code for java.net.URL definition code for java.net.URL [] urls,
            ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent)
Constructs a new MLet for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader. The parent argument will be used as the parent class loader for delegation.

Parameters:
urls - The URLs from which to load classes and resources.
parent - The parent class loader for delegation.

MLet sample code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory) definition code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory)

public MLet(URL sample code for java.net.URL definition code for java.net.URL [] urls,
            ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent,
            URLStreamHandlerFactory sample code for java.net.URLStreamHandlerFactory definition code for java.net.URLStreamHandlerFactory  factory)
Constructs a new MLet for the specified URLs, parent class loader, and URLStreamHandlerFactory. The parent argument will be used as the parent class loader for delegation. The factory argument will be used as the stream handler factory to obtain protocol handlers when creating new URLs.

Parameters:
urls - The URLs from which to load classes and resources.
parent - The parent class loader for delegation.
factory - The URLStreamHandlerFactory to use when creating URLs.

MLet sample code for javax.management.loading.MLet(java.net.URL[], boolean) definition code for javax.management.loading.MLet(java.net.URL[], boolean)

public MLet(URL sample code for java.net.URL definition code for java.net.URL [] urls,
            boolean delegateToCLR)
Constructs a new MLet for the specified URLs using the default delegation parent ClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the parent class loader.

Parameters:
urls - The URLs from which to load classes and resources.
delegateToCLR - True if, when a class is not found in either the parent ClassLoader or the URLs, the MLet should delegate to its containing MBeanServer's ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository .

MLet sample code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader, boolean) definition code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader, boolean)

public MLet(URL sample code for java.net.URL definition code for java.net.URL [] urls,
            ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent,
            boolean delegateToCLR)
Constructs a new MLet for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader. The parent argument will be used as the parent class loader for delegation.

Parameters:
urls - The URLs from which to load classes and resources.
parent - The parent class loader for delegation.
delegateToCLR - True if, when a class is not found in either the parent ClassLoader or the URLs, the MLet should delegate to its containing MBeanServer's ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository .

MLet sample code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory, boolean) definition code for javax.management.loading.MLet(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory, boolean)

public MLet(URL sample code for java.net.URL definition code for java.net.URL [] urls,
            ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  parent,
            URLStreamHandlerFactory sample code for java.net.URLStreamHandlerFactory definition code for java.net.URLStreamHandlerFactory  factory,
            boolean delegateToCLR)
Constructs a new MLet for the specified URLs, parent class loader, and URLStreamHandlerFactory. The parent argument will be used as the parent class loader for delegation. The factory argument will be used as the stream handler factory to obtain protocol handlers when creating new URLs.

Parameters:
urls - The URLs from which to load classes and resources.
parent - The parent class loader for delegation.
factory - The URLStreamHandlerFactory to use when creating URLs.
delegateToCLR - True if, when a class is not found in either the parent ClassLoader or the URLs, the MLet should delegate to its containing MBeanServer's ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository .
Method Detail

addURL sample code for javax.management.loading.MLet.addURL(java.net.URL) definition code for javax.management.loading.MLet.addURL(java.net.URL)

public void addURL(URL sample code for java.net.URL definition code for java.net.URL  url)
Appends the specified URL to the list of URLs to search for classes and resources.

Specified by:
addURL sample code for javax.management.loading.MLetMBean.addURL(java.net.URL) definition code for javax.management.loading.MLetMBean.addURL(java.net.URL) in interface MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
Overrides:
addURL sample code for java.net.URLClassLoader.addURL(java.net.URL) definition code for java.net.URLClassLoader.addURL(java.net.URL) in class URLClassLoader sample code for java.net.URLClassLoader definition code for java.net.URLClassLoader
Parameters:
url - the URL to be added to the search path of URLs

addURL sample code for javax.management.loading.MLet.addURL(java.lang.String) definition code for javax.management.loading.MLet.addURL(java.lang.String)

public void addURL(String sample code for java.lang.String definition code for java.lang.String  url)
            throws ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException 
Appends the specified URL to the list of URLs to search for classes and resources.

Specified by:
addURL sample code for javax.management.loading.MLetMBean.addURL(java.lang.String) definition code for javax.management.loading.MLetMBean.addURL(java.lang.String) in interface MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
Parameters:
url - the URL to add.
Throws:
ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException - The specified URL is malformed.

getURLs sample code for javax.management.loading.MLet.getURLs() definition code for javax.management.loading.MLet.getURLs()

public URL sample code for java.net.URL definition code for java.net.URL [] getURLs()
Returns the search path of URLs for loading classes and resources. This includes the original list of URLs specified to the constructor, along with any URLs subsequently appended by the addURL() method.

Specified by:
getURLs sample code for javax.management.loading.MLetMBean.getURLs() definition code for javax.management.loading.MLetMBean.getURLs() in interface MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
Overrides:
getURLs sample code for java.net.URLClassLoader.getURLs() definition code for java.net.URLClassLoader.getURLs() in class URLClassLoader sample code for java.net.URLClassLoader definition code for java.net.URLClassLoader
Returns:
the search path of URLs for loading classes and resources.

getMBeansFromURL sample code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL) definition code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL)

public Set sample code for java.util.Set definition code for java.util.Set  getMBeansFromURL(URL sample code for java.net.URL definition code for java.net.URL  url)
                     throws ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException 
Loads a text file containing MLET tags that define the MBeans to be added to the agent. The location of the text file is specified by a URL. The MBeans specified in the MLET file will be instantiated and registered by the MBean server.

Specified by:
getMBeansFromURL sample code for javax.management.loading.MLetMBean.getMBeansFromURL(java.net.URL) definition code for javax.management.loading.MLetMBean.getMBeansFromURL(java.net.URL) in interface MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
Parameters:
url - The URL of the text file to be loaded as URL object.
Returns:
A set containing one entry per MLET tag in the m-let text file loaded. Each entry specifies either the ObjectInstance for the created MBean, or a throwable object (that is, an error or an exception) if the MBean could not be created.
Throws:
ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException - One of the following errors has occurred: The m-let text file does not contain an MLET tag, the m-let text file is not found, a mandatory attribute of the MLET tag is not specified, the value of url is null.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - MLet MBean is not registered with an MBeanServer.

getMBeansFromURL sample code for javax.management.loading.MLet.getMBeansFromURL(java.lang.String) definition code for javax.management.loading.MLet.getMBeansFromURL(java.lang.String)

public Set sample code for java.util.Set definition code for java.util.Set  getMBeansFromURL(String sample code for java.lang.String definition code for java.lang.String  url)
                     throws ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException 
Loads a text file containing MLET tags that define the MBeans to be added to the agent. The location of the text file is specified by a URL. The MBeans specified in the MLET file will be instantiated and registered by the MBean server.

Specified by:
getMBeansFromURL sample code for javax.management.loading.MLetMBean.getMBeansFromURL(java.lang.String) definition code for javax.management.loading.MLetMBean.getMBeansFromURL(java.lang.String) in interface MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
Parameters:
url - The URL of the text file to be loaded as String object.
Returns:
A set containing one entry per MLET tag in the m-let text file loaded. Each entry specifies either the ObjectInstance for the created MBean, or a throwable object (that is, an error or an exception) if the MBean could not be created.
Throws:
ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException - One of the following errors has occurred: The m-let text file does not contain an MLET tag, the m-let text file is not found, a mandatory attribute of the MLET tag is not specified, the url is malformed.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - MLet MBean is not registered with an MBeanServer.

getLibraryDirectory sample code for javax.management.loading.MLet.getLibraryDirectory() definition code for javax.management.loading.MLet.getLibraryDirectory()

public String sample code for java.lang.String definition code for java.lang.String  getLibraryDirectory()
Gets the current directory used by the library loader for storing native libraries before they are loaded into memory.

Specified by:
getLibraryDirectory sample code for javax.management.loading.MLetMBean.getLibraryDirectory() definition code for javax.management.loading.MLetMBean.getLibraryDirectory() in interface MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
Returns:
The current directory used by the library loader.
See Also:
setLibraryDirectory(java.lang.String) sample code for javax.management.loading.MLet.setLibraryDirectory(java.lang.String) definition code for javax.management.loading.MLet.setLibraryDirectory(java.lang.String)

setLibraryDirectory sample code for javax.management.loading.MLet.setLibraryDirectory(java.lang.String) definition code for javax.management.loading.MLet.setLibraryDirectory(java.lang.String)

public void setLibraryDirectory(String sample code for java.lang.String definition code for java.lang.String  libdir)
Sets the directory used by the library loader for storing native libraries before they are loaded into memory.

Specified by:
setLibraryDirectory sample code for javax.management.loading.MLetMBean.setLibraryDirectory(java.lang.String) definition code for javax.management.loading.MLetMBean.setLibraryDirectory(java.lang.String) in interface MLetMBean sample code for javax.management.loading.MLetMBean definition code for javax.management.loading.MLetMBean
Parameters:
libdir - The directory used by the library loader.
See Also:
getLibraryDirectory() sample code for javax.management.loading.MLet.getLibraryDirectory() definition code for javax.management.loading.MLet.getLibraryDirectory()

preRegister sample code for javax.management.loading.MLet.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.loading.MLet.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

public ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  preRegister(MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  server,
                              ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
                       throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 
Allows the m-let to perform any operations it needs before being registered in the MBean server. If the ObjectName is null, the m-let provides a default name for its registration <defaultDomain>:type=MLet

Specified by:
preRegister sample code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName) in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Parameters:
server - The MBean server in which the m-let will be registered.
name - The object name of the m-let.
Returns:
The name of the m-let registered.
Throws:
Exception sample code for java.lang.Exception definition code for java.lang.Exception - This exception should be caught by the MBean server and re-thrown as an MBeanRegistrationException.

postRegister sample code for javax.management.loading.MLet.postRegister(java.lang.Boolean) definition code for javax.management.loading.MLet.postRegister(java.lang.Boolean)

public void postRegister(Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  registrationDone)
Allows the m-let to perform any operations needed after having been registered in the MBean server or after the registration has failed.

Specified by:
postRegister sample code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean) definition code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean) in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Parameters:
registrationDone - Indicates whether or not the m-let has been successfully registered in the MBean server. The value false means that either the registration phase has failed.

preDeregister sample code for javax.management.loading.MLet.preDeregister() definition code for javax.management.loading.MLet.preDeregister()

public void preDeregister()
                   throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 
Allows the m-let to perform any operations it needs before being unregistered by the MBean server.

Specified by:
preDeregister sample code for javax.management.MBeanRegistration.preDeregister() definition code for javax.management.MBeanRegistration.preDeregister() in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Throws:
java.langException - This exception should be caught by the MBean server and re-thrown as an MBeanRegistrationException.
Exception sample code for java.lang.Exception definition code for java.lang.Exception - This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException sample code for javax.management.MBeanRegistrationException definition code for javax.management.MBeanRegistrationException .

postDeregister sample code for javax.management.loading.MLet.postDeregister() definition code for javax.management.loading.MLet.postDeregister()

public void postDeregister()
Allows the m-let to perform any operations needed after having been unregistered in the MBean server.

Specified by:
postDeregister sample code for javax.management.MBeanRegistration.postDeregister() definition code for javax.management.MBeanRegistration.postDeregister() in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration

writeExternal sample code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput) definition code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput)

public void writeExternal(ObjectOutput sample code for java.io.ObjectOutput definition code for java.io.ObjectOutput  out)
                   throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                          UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException 

Save this MLet's contents to the given ObjectOutput sample code for java.io.ObjectOutput definition code for java.io.ObjectOutput . Not all implementations support this method. Those that do not throw UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException . A subclass may override this method to support it or to change the format of the written data.

The format of the written data is not specified, but if an implementation supports writeExternal(java.io.ObjectOutput) sample code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput) definition code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput) it must also support readExternal(java.io.ObjectInput) sample code for javax.management.loading.MLet.readExternal(java.io.ObjectInput) definition code for javax.management.loading.MLet.readExternal(java.io.ObjectInput) in such a way that what is written by the former can be read by the latter.

Specified by:
writeExternal sample code for java.io.Externalizable.writeExternal(java.io.ObjectOutput) definition code for java.io.Externalizable.writeExternal(java.io.ObjectOutput) in interface Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable
Parameters:
out - The object output stream to write to.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - If a problem occurred while writing.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - If this implementation does not support this operation.

readExternal sample code for javax.management.loading.MLet.readExternal(java.io.ObjectInput) definition code for javax.management.loading.MLet.readExternal(java.io.ObjectInput)

public void readExternal(ObjectInput sample code for java.io.ObjectInput definition code for java.io.ObjectInput  in)
                  throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                         ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException ,
                         UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException 

Restore this MLet's contents from the given ObjectInput sample code for java.io.ObjectInput definition code for java.io.ObjectInput . Not all implementations support this method. Those that do not throw UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException . A subclass may override this method to support it or to change the format of the read data.

The format of the read data is not specified, but if an implementation supports readExternal(java.io.ObjectInput) sample code for javax.management.loading.MLet.readExternal(java.io.ObjectInput) definition code for javax.management.loading.MLet.readExternal(java.io.ObjectInput) it must also support writeExternal(java.io.ObjectOutput) sample code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput) definition code for javax.management.loading.MLet.writeExternal(java.io.ObjectOutput) in such a way that what is written by the latter can be read by the former.

Specified by:
readExternal sample code for java.io.Externalizable.readExternal(java.io.ObjectInput) definition code for java.io.Externalizable.readExternal(java.io.ObjectInput) in interface Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable
Parameters:
in - The object input stream to read from.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if a problem occurred while reading.
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - if the class for the object being restored cannot be found.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if this implementation does not support this operation.

loadClass sample code for javax.management.loading.MLet.loadClass(java.lang.String, javax.management.loading.ClassLoaderRepository) definition code for javax.management.loading.MLet.loadClass(java.lang.String, javax.management.loading.ClassLoaderRepository)

public Class sample code for java.lang.Class definition code for java.lang.Class  loadClass(String sample code for java.lang.String definition code for java.lang.String  name,
                       ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository  clr)
                throws ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException 

Load a class, using the given ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository if the class is not found in this MLet's URLs. The given ClassLoaderRepository can be null, in which case a ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException occurs immediately if the class is not found in this MLet's URLs.

Parameters:
name - The name of the class we want to load.
clr - The ClassLoaderRepository that will be used to search for the given class, if it is not found in this ClassLoader. May be null.
Returns:
The resulting Class object.
Throws:
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - The specified class could not be found in this ClassLoader nor in the given ClassLoaderRepository.

findClass sample code for javax.management.loading.MLet.findClass(java.lang.String) definition code for javax.management.loading.MLet.findClass(java.lang.String)

protected Class sample code for java.lang.Class definition code for java.lang.Class  findClass(String sample code for java.lang.String definition code for java.lang.String  name)
                   throws ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException 
This is the main method for class loaders that is being redefined.

Overrides:
findClass sample code for java.net.URLClassLoader.findClass(java.lang.String) definition code for java.net.URLClassLoader.findClass(java.lang.String) in class URLClassLoader sample code for java.net.URLClassLoader definition code for java.net.URLClassLoader
Parameters:
name - The name of the class.
Returns:
The resulting Class object.
Throws:
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - The specified class could not be found.

findLibrary sample code for javax.management.loading.MLet.findLibrary(java.lang.String) definition code for javax.management.loading.MLet.findLibrary(java.lang.String)

protected String sample code for java.lang.String definition code for java.lang.String  findLibrary(String sample code for java.lang.String definition code for java.lang.String  libname)
Returns the absolute path name of a native library. The VM invokes this method to locate the native libraries that belong to classes loaded with this class loader. Libraries are searched in the JAR files using first just the native library name and if not found the native library name together with the architecture-specific path name (OSName/OSArch/OSVersion/lib/nativelibname), i.e.

the library stat on Solaris SPARC 5.7 will be searched in the JAR file as:

  1. libstat.so
  2. SunOS/sparc/5.7/lib/libstat.so
the library stat on Windows NT 4.0 will be searched in the JAR file as:
  1. stat.dll
  2. WindowsNT/x86/4.0/lib/stat.dll

If this method returns null, i.e. the libraries were not found in any of the JAR files loaded with this class loader, the VM searches the library along the path specified as the java.library.path property.

Overrides:
findLibrary sample code for java.lang.ClassLoader.findLibrary(java.lang.String) definition code for java.lang.ClassLoader.findLibrary(java.lang.String) in class ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader
Parameters:
libname - The library name.
Returns:
The absolute path of the native library.
See Also:
System.loadLibrary(String) sample code for java.lang.System.loadLibrary(java.lang.String) definition code for java.lang.System.loadLibrary(java.lang.String) , System.mapLibraryName(String) sample code for java.lang.System.mapLibraryName(java.lang.String) definition code for java.lang.System.mapLibraryName(java.lang.String)

check sample code for javax.management.loading.MLet.check(java.lang.String, java.net.URL, java.lang.String, javax.management.loading.MLetContent) definition code for javax.management.loading.MLet.check(java.lang.String, java.net.URL, java.lang.String, javax.management.loading.MLetContent)

protected URL sample code for java.net.URL definition code for java.net.URL  check(String sample code for java.lang.String definition code for java.lang.String  version,
                    URL sample code for java.net.URL definition code for java.net.URL  codebase,
                    String sample code for java.lang.String definition code for java.lang.String  jarfile,
                    javax.management.loading.MLetContent mlet)
             throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 

This method is to be overridden when extending this service to support caching and versioning. It is called from getMBeansFromURL sample code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL) definition code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL) when the version, codebase, and jarfile have been extracted from the MLet file, and can be used to verify that it is all right to load the given MBean, or to replace the given URL with a different one.

The default implementation of this method returns codebase unchanged.

Parameters:
version - The version number of the .jar file stored locally.
codebase - The base URL of the remote .jar file.
jarfile - The name of the .jar file to be loaded.
mlet - The MLetContent instance that represents the MLET tag.
Returns:
the codebase to use for the loaded MBean. The returned value should not be null.
Throws:
Exception sample code for java.lang.Exception definition code for java.lang.Exception - if the MBean is not to be loaded for some reason. The exception will be added to the set returned by getMBeansFromURL sample code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL) definition code for javax.management.loading.MLet.getMBeansFromURL(java.net.URL) .