Instantiates and registers an MBean in the MBean server. The
class loader to be used is identified by its object name. An
object name is associated to the MBean. If the object name of
the loader is not specified, the ClassLoader that loaded the
MBean server will be used. If the MBean object name given is
null, the MBean must provide its own name by implementing the
MBeanRegistration
interface and returning the name from the
preRegister
method.
Returns:
An
ObjectInstance
, containing the
ObjectName
and the Java class name of the newly
instantiated MBean. If the contained
ObjectName
is
n
, the contained Java class name is
{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()
.
Parameters:
-
className - The class name of the MBean to be instantiated.
-
name - The object name of the MBean. May be null.
-
params - An array containing the parameters of the
constructor to be invoked.
-
signature - An array containing the signature of the
constructor to be invoked.
-
loaderName - The object name of the class loader to be used.
Throws:
-
ReflectionException - Wraps a
java.lang.ClassNotFoundException
or a
java.lang.Exception
that occurred when trying to
invoke the MBean's constructor.
-
InstanceAlreadyExistsException - The MBean is already
under the control of the MBean server.
-
MBeanRegistrationException - The
preRegister
(
MBeanRegistration
interface) method of the MBean has thrown an exception. The
MBean will not be registered.
-
MBeanException - The constructor of the MBean has
thrown an exception
-
NotCompliantMBeanException - This class is not a JMX
compliant MBean
-
InstanceNotFoundException - The specified class loader
is not registered in the MBean server.
-
RuntimeOperationsException - Wraps a
java.lang.IllegalArgumentException
: The className
passed in parameter is null, the
ObjectName
passed
in parameter contains a pattern or no
ObjectName
is specified for the MBean.
-
IOException - A communication problem occurred when
talking to the MBean server.