FileDocCategorySizeDatePackage
MBeanInstantiator.javaAPI DocJava SE 5 API10167Fri Aug 26 14:54:58 BST 2005com.sun.jmx.mbeanserver

MBeanInstantiator

public interface MBeanInstantiator
Contains methods for instantiating objects, finding the class given its name and using different class loaders, deserializing objects in the context of a given class loader.
since
1.5
since.unbundled
JMX RI 1.2

Fields Summary
Constructors Summary
Methods Summary
public java.io.ObjectInputStreamdeserialize(java.lang.ClassLoader loader, byte[] data)
De-serializes a byte array in the context of a classloader.

param
loader the classloader to use for de-serialization
param
data The byte array to be de-sererialized.
return
The de-serialized object stream.
exception
OperationsException Any of the usual Input/Output related exceptions.

public java.io.ObjectInputStreamdeserialize(java.lang.String className, javax.management.ObjectName loaderName, byte[] data, java.lang.ClassLoader loader)
De-serializes a byte array in the context of a given MBean class loader.

The class loader is the one that loaded the class with name "className".

The name of the class loader to be used for loading the specified class is specified. If null, a default one has to be provided (for a MBean Server, its own class loader will be used).

param
className The name of the class whose class loader should be used for the de-serialization.
param
data The byte array to be de-sererialized.
param
loaderName The name of the class loader to be used for loading the specified class. If null, a default one has to be provided (for a MBean Server, its own class loader will be used).
return
The de-serialized object stream.
exception
InstanceNotFoundException The specified class loader MBean is not found.
exception
OperationsException Any of the usual Input/Output related exceptions.
exception
ReflectionException The specified class could not be loaded by the specified class loader.

public java.lang.ClassfindClass(java.lang.String className, java.lang.ClassLoader loader)
Gets the class for the specified class name using the MBean Interceptor's classloader

public java.lang.ClassfindClass(java.lang.String className, javax.management.ObjectName loaderName)
Gets the class for the specified class name using the specified class loader

public java.lang.ClassfindClassWithDefaultLoaderRepository(java.lang.String className)
Loads the class with the specified name using this object's Default Loader Repository.

public java.lang.Class[]findSignatureClasses(java.lang.String[] signature, java.lang.ClassLoader loader)
Return an array of Class corresponding to the given signature, using the specified class loader.

public com.sun.jmx.mbeanserver.ModifiableClassLoaderRepositorygetClassLoaderRepository()
Return the Default Loader Repository used by this instantiator object.

public java.lang.Objectinstantiate(java.lang.String className, javax.management.ObjectName loaderName, java.lang.ClassLoader loader)
Instantiates an object using the class Loader specified by its ObjectName.

If the loader name is null, a default one has to be provided (for a MBean Server, the ClassLoader that loaded it will be used).

The object's class should have a public constructor.

It returns a reference to the newly created object.

The newly created object is not registered in the MBean Interceptor.

param
className The class name of the MBean to be instantiated.
param
loaderName The object name of the class loader to be used.
return
The newly instantiated object.
exception
ReflectionException Wraps a java.lang.ClassNotFoundException or the java.lang.Exception that occurred when trying to invoke the object's constructor.
exception
MBeanException The constructor of the object has thrown an exception.
exception
InstanceNotFoundException The specified class loader is not registered in the MBeanServerInterceptor.
exception
RuntimeOperationsException Wraps a java.lang.IllegalArgumentException: the className passed in parameter is null.

public java.lang.Objectinstantiate(java.lang.String className, java.lang.Object[] params, java.lang.String[] signature, java.lang.ClassLoader loader)
Instantiates an object using the list of all class loaders registered in the MBean server (using its {@link javax.management.loading.ClassLoaderRepository}).

The object's class should have a public constructor.

The call returns a reference to the newly created object.

The newly created object is not registered in the MBean Interceptor.

param
className The class name of the object to be instantiated.
param
params An array containing the parameters of the constructor to be invoked.
param
signature An array containing the signature of the constructor to be invoked.
return
The newly instantiated object.
exception
ReflectionException Wraps a java.lang.ClassNotFoundException or the java.lang.Exception that occurred when trying to invoke the object's constructor.
exception
MBeanException The constructor of the object has thrown an exception
exception
RuntimeOperationsException Wraps a java.lang.IllegalArgumentException: the className passed in parameter is null.

public java.lang.Objectinstantiate(java.lang.String className, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature, java.lang.ClassLoader loader)
Instantiates an object. The class loader to be used is identified by its object name.

If the object name of the loader is null, a default has to be provided (for example, for a MBean Server, the ClassLoader that loaded it will be used).

The object's class should have a public constructor.

The call returns a reference to the newly created object.

The newly created object is not registered in the MBean server.

param
className The class name of the object to be instantiated.
param
params An array containing the parameters of the constructor to be invoked.
param
signature An array containing the signature of the constructor to be invoked.
param
loaderName The object name of the class loader to be used.
return
The newly instantiated object.
exception
ReflectionException Wraps a java.lang.ClassNotFoundException or the java.lang.Exception that occurred when trying to invoke the object's constructor.
exception
MBeanException The constructor of the object has thrown an exception
exception
InstanceNotFoundException The specified class loader is not registered in the MBean Interceptor.
exception
RuntimeOperationsException Wraps a java.lang.IllegalArgumentException: the className passed in parameter is null.

public java.lang.Objectinstantiate(java.lang.Class theClass)
Instantiates an object given its class, using its empty constructor. The call returns a reference to the newly created object.

public java.lang.Objectinstantiate(java.lang.Class theClass, java.lang.Object[] params, java.lang.String[] signature, java.lang.ClassLoader loader)
Instantiates an object given its class, the parameters and signature of its constructor The call returns a reference to the newly created object.

public java.lang.Objectinstantiate(java.lang.String className)
Instantiates an object using the list of all class loaders registered in the MBean Interceptor (using its {@link javax.management.loading.ClassLoaderRepository}).

The object's class should have a public constructor.

It returns a reference to the newly created object.

The newly created object is not registered in the MBean Interceptor.

param
className The class name of the object to be instantiated.
return
The newly instantiated object.
exception
ReflectionException Wraps a java.lang.ClassNotFoundException or the java.lang.Exception that occurred when trying to invoke the object's constructor.
exception
MBeanException The constructor of the object has thrown an exception
exception
RuntimeOperationsException Wraps a java.lang.IllegalArgumentException: the className passed in parameter is null.

public voidtestCreation(java.lang.Class c)
This methods tests if the MBean class makes it possible to instantiate an MBean of this class in the MBeanServer. e.g. it must have a public constructor, be a concrete class...