|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jdmk.MBeanInstantiatorImpl
public class MBeanInstantiatorImpl
Implements the MBeanInstantiator interface. Provides 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.
Constructor Summary | |
---|---|
MBeanInstantiatorImpl(ModifiableClassLoaderRepository clr)
Deprecated. |
Method Summary | |
---|---|
Attribute |
checkTransferAttribute(ClassLoader dest,
Attribute attribute)
Deprecated. Check whether the attribute value needs to be transferred in the destination class loader. |
AttributeList |
checkTransferAttributeList(ClassLoader dest,
AttributeList attributes)
Deprecated. Check whether the attribute values needs to be transferred in the destination class loader. |
Object |
checkTransferObject(ClassLoader targetLoader,
Object value)
Deprecated. Check whether the given value need to be transferred into the target class loader. |
Object[] |
checkTransferParameters(ClassLoader dest,
Object[] params)
Deprecated. Check whether the given parameters need to be transferred into the target class loader. |
ObjectInputStream |
deserialize(ObjectName name,
byte[] data)
Deprecated. De-serializes a byte array in the context of the class loader of an MBean. |
ObjectInputStream |
deserialize(String className,
byte[] data)
Deprecated. De-serializes a byte array in the context of a given MBean class loader. |
ObjectInputStream |
deserialize(String className,
ObjectName loaderName,
byte[] data,
ClassLoader loader)
Deprecated. De-serializes a byte array in the context of a given MBean class loader. |
Class |
findClass(String className,
ClassLoader loader)
Deprecated. Gets the class for the specified class name using the MBean Interceptor's classloader |
Class |
findClass(String className,
ObjectName aLoader)
Deprecated. Gets the class for the specified class name using the specified class loader |
Class |
findClassWithDefaultLoaderRepository(String className)
Deprecated. Loads the class with the specified name using this object's Default Loader Repository. |
Class[] |
findSignatureClasses(String[] signature,
ClassLoader loader)
Deprecated. Return an array of Class corresponding to the given signature, using the specified class loader. |
ModifiableClassLoaderRepository |
getClassLoaderRepository()
Deprecated. Return the Default Loader Repository used by this instantiator object. |
Object |
instantiate(Class theClass)
Deprecated. Instantiates an object given its class, using its empty constructor. |
Object |
instantiate(Class theClass,
Object[] params,
String[] signature,
ClassLoader loader)
Deprecated. Instantiates an object given its class, the parameters and signature of its constructor The call returns a reference to the newly created object. |
Object |
instantiate(String className)
Deprecated. Instantiates an object using the list of all class loaders registered in the MBean Interceptor (using its ClassLoaderRepository ). |
Object |
instantiate(String className,
Object[] params,
String[] signature,
ClassLoader loader)
Deprecated. Instantiates an object using the list of all class loaders registered in the MBean server (using its ClassLoaderRepository ). |
Object |
instantiate(String className,
ObjectName loaderName,
ClassLoader loader)
Deprecated. Instantiates an object using the class Loader specified by its ObjectName . |
Object |
instantiate(String className,
ObjectName loaderName,
Object[] params,
String[] signature,
ClassLoader loader)
Deprecated. Instantiates an object. |
void |
testCreation(Class c)
Deprecated. This methods tests if the MBean class makes it possible to instantiate an MBean of this class in the MBeanServer. |
Object |
transferObject(Object obj,
ClassLoader aloader)
Deprecated. Transfer a given object into the context of a different class loader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MBeanInstantiatorImpl(ModifiableClassLoaderRepository clr)
Method Detail |
---|
public void testCreation(Class c) throws NotCompliantMBeanException
MBeanInstantiator
testCreation
in interface MBeanInstantiator
NotCompliantMBeanException
public Class findClassWithDefaultLoaderRepository(String className) throws ReflectionException
MBeanInstantiator
findClassWithDefaultLoaderRepository
in interface MBeanInstantiator
ReflectionException
public Class findClass(String className, ClassLoader loader) throws ReflectionException
MBeanInstantiator
findClass
in interface MBeanInstantiator
ReflectionException
public Class findClass(String className, ObjectName aLoader) throws ReflectionException, InstanceNotFoundException
MBeanInstantiator
findClass
in interface MBeanInstantiator
ReflectionException
InstanceNotFoundException
public Class[] findSignatureClasses(String[] signature, ClassLoader loader) throws ReflectionException
MBeanInstantiator
findSignatureClasses
in interface MBeanInstantiator
ReflectionException
public Object instantiate(Class theClass) throws ReflectionException, MBeanException
MBeanInstantiator
instantiate
in interface MBeanInstantiator
ReflectionException
MBeanException
public Object instantiate(Class theClass, Object[] params, String[] signature, ClassLoader loader) throws ReflectionException, MBeanException
MBeanInstantiator
instantiate
in interface MBeanInstantiator
ReflectionException
MBeanException
public final AttributeList checkTransferAttributeList(ClassLoader dest, AttributeList attributes)
MBeanInstantiator
The method checks if the context of the operation is ok, i.e if all the attribute values are coming from the same class loader. If not, the method will replace the attributes that need to be transferred by a new attribute object transferred in the target class loader.
checkTransferAttributeList
in interface MBeanInstantiator
dest
- the target class loader.attributes
- the attribute list to be checked.
public Attribute checkTransferAttribute(ClassLoader dest, Attribute attribute)
MBeanInstantiator
The method checks if the context of the operation is ok, i.e if all the attribute values are coming from the same class loader. If not, the method will replace the attributes that need to be transferred by a new attribute object transferred in the target class loader.
checkTransferAttribute
in interface MBeanInstantiator
dest
- the target class loader.attribute
- attribute to be checked.
public Object[] checkTransferParameters(ClassLoader dest, Object[] params)
MBeanInstantiator
The method checks if the context of the operation is ok, i.e if all the objects are coming from the same class loader. If not, the method will replace the parameters that need to be transferred by a new object transferred in the target class loader.
checkTransferParameters
in interface MBeanInstantiator
dest
- the target class loader.params
- parameters to be checked.
public Object checkTransferObject(ClassLoader targetLoader, Object value)
MBeanInstantiator
The method checks if the context of the operation is ok, i.e if the value is coming from the target class loader. If not, the method will return a new object transferred in the target class loader.
checkTransferObject
in interface MBeanInstantiator
targetLoader
- the target class loader.value
- object to be checked.
public Object transferObject(Object obj, ClassLoader aloader)
MBeanInstantiator
transferObject
in interface MBeanInstantiator
public ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException, OperationsException
MBeanInstantiator
deserialize
in interface MBeanInstantiator
name
- The name of the MBean whose class loader should be used for
the de-serialization.data
- The byte array to be de-sererialized.
InstanceNotFoundException
- The MBean specified is not found.
OperationsException
- Any of the usual Input/Output related
exceptions.public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException, ReflectionException
MBeanInstantiator
deserialize
in interface MBeanInstantiator
className
- The name of the class whose class loader should
be used for the de-serialization.data
- The byte array to be de-sererialized.
OperationsException
- Any of the usual Input/Output related
exceptions.
ReflectionException
- The specified class could not be loaded
by the default loader repositorypublic ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data, ClassLoader loader) throws InstanceNotFoundException, OperationsException, ReflectionException
MBeanInstantiator
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).
deserialize
in interface MBeanInstantiator
className
- The name of the class whose class loader should be
used for the de-serialization.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).data
- The byte array to be de-sererialized.loader
- default class loader.
InstanceNotFoundException
- The specified class loader MBean is
not found.
OperationsException
- Any of the usual Input/Output related
exceptions.
ReflectionException
- The specified class could not be loaded
by the specified class loader.public Object instantiate(String className) throws ReflectionException, MBeanException
MBeanInstantiator
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.
instantiate
in interface MBeanInstantiator
className
- The class name of the object to be instantiated.
ReflectionException
- Wraps a
java.lang.ClassNotFoundException
or the
java.lang.Exception
that occurred when trying to invoke the
object's constructor.
MBeanException
- The constructor of the object has thrown an
exceptionpublic Object instantiate(String className, ObjectName loaderName, ClassLoader loader) throws ReflectionException, MBeanException, InstanceNotFoundException
MBeanInstantiator
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.
instantiate
in interface MBeanInstantiator
className
- The class name of the MBean to be instantiated.loaderName
- The object name of the class loader to be used.
ReflectionException
- Wraps a
java.lang.ClassNotFoundException
or the
java.lang.Exception
that occurred when trying to invoke the
object's constructor.
MBeanException
- The constructor of the object has thrown an
exception.
InstanceNotFoundException
- The specified class loader is not
registered in the MBeanInterceptor.public Object instantiate(String className, Object[] params, String[] signature, ClassLoader loader) throws ReflectionException, MBeanException
MBeanInstantiator
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.
instantiate
in interface MBeanInstantiator
className
- The class name of the object to be instantiated.params
- An array containing the parameters of the constructor to
be invoked.signature
- An array containing the signature of the constructor to
be invoked.
ReflectionException
- Wraps a
java.lang.ClassNotFoundException
or the
java.lang.Exception
that occurred when trying to invoke the
object's constructor.
MBeanException
- The constructor of the object has thrown an
exceptionpublic Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature, ClassLoader loader) throws ReflectionException, MBeanException, InstanceNotFoundException
MBeanInstantiator
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.
instantiate
in interface MBeanInstantiator
className
- The class name of the object to be instantiated.loaderName
- The object name of the class loader to be used.params
- An array containing the parameters of the constructor to
be invoked.signature
- An array containing the signature of the constructor to
be invoked.
ReflectionException
- Wraps a
java.lang.ClassNotFoundException
or the
java.lang.Exception
that occurred when trying to invoke the
object's constructor.
MBeanException
- The constructor of the object has thrown an
exception
InstanceNotFoundException
- The specified class loader is not
registered in the MBean Interceptor.public ModifiableClassLoaderRepository getClassLoaderRepository()
MBeanInstantiator
getClassLoaderRepository
in interface MBeanInstantiator
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |