Interface MBeanServerConnection

All Known Subinterfaces:
MBeanServer, MBeanServerForwarder

public interface MBeanServerConnection
This interface represents a way to talk to an MBean server, whether local or remote. The MBeanServer interface, representing a local MBean server, extends this interface.
Since:
1.5
  • Method Details

    • createMBean

      Instantiates and registers an MBean in the MBean server. The MBean server will use its Default Loader Repository to load the class of the MBean. An object name is associated with the MBean. If the 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.

      This method is equivalent to createMBean(className, name, (Object[]) null, (String[]) null).

      Parameters:
      className - The class name of the MBean to be instantiated.
      name - The object name of the MBean. May be null.
      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 getMBeanInfo(n).getClassName().
      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.
      RuntimeMBeanException - If the MBean's constructor or its preRegister or postRegister method threw a RuntimeException. If the postRegister (MBeanRegistration interface) method of the MBean throws a RuntimeException, the createMBean method will throw a RuntimeMBeanException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeMBeanException can also be thrown by preRegister, in which case the MBean will not be registered.
      RuntimeErrorException - If the postRegister (MBeanRegistration interface) method of the MBean throws an Error, the createMBean method will throw a RuntimeErrorException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeErrorException can also be thrown by preRegister, in which case 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
      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.
      See Also:
    • createMBean

      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 with the MBean. If the object name of the loader is null, the ClassLoader that loaded the MBean server will be used. If the MBean's 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.

      This method is equivalent to createMBean(className, name, loaderName, (Object[]) null, (String[]) null).

      Parameters:
      className - The class name of the MBean to be instantiated.
      name - The object name of the MBean. May be null.
      loaderName - The object name of the class loader to be used.
      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 getMBeanInfo(n).getClassName().
      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.
      RuntimeMBeanException - If the MBean's constructor or its preRegister or postRegister method threw a RuntimeException. If the postRegister (MBeanRegistration interface) method of the MBean throws a RuntimeException, the createMBean method will throw a RuntimeMBeanException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeMBeanException can also be thrown by preRegister, in which case the MBean will not be registered.
      RuntimeErrorException - If the postRegister (MBeanRegistration interface) method of the MBean throws an Error, the createMBean method will throw a RuntimeErrorException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeErrorException can also be thrown by preRegister, in which case 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.
      See Also:
    • createMBean

      Instantiates and registers an MBean in the MBean server. The MBean server will use its Default Loader Repository to load the class of the MBean. An object name is associated with the MBean. If the 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.
      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.
      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 getMBeanInfo(n).getClassName().
      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.
      RuntimeMBeanException - If the MBean's constructor or its preRegister or postRegister method threw a RuntimeException. If the postRegister (MBeanRegistration interface) method of the MBean throws a RuntimeException, the createMBean method will throw a RuntimeMBeanException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeMBeanException can also be thrown by preRegister, in which case the MBean will not be registered.
      RuntimeErrorException - If the postRegister (MBeanRegistration interface) method of the MBean throws an Error, the createMBean method will throw a RuntimeErrorException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeErrorException can also be thrown by preRegister, in which case 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
      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.
      See Also:
    • createMBean

      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 with 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.

      Parameters:
      className - The class name of the MBean to be instantiated.
      name - The object name of the MBean. May be null.
      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.
      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 getMBeanInfo(n).getClassName().
      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.
      RuntimeMBeanException - The MBean's constructor or its preRegister or postRegister method threw a RuntimeException. If the postRegister (MBeanRegistration interface) method of the MBean throws a RuntimeException, the createMBean method will throw a RuntimeMBeanException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeMBeanException can also be thrown by preRegister, in which case the MBean will not be registered.
      RuntimeErrorException - If the postRegister method (MBeanRegistration interface) method of the MBean throws an Error, the createMBean method will throw a RuntimeErrorException, although the MBean creation and registration succeeded. In such a case, the MBean will be actually registered even though the createMBean method threw an exception. Note that RuntimeErrorException can also be thrown by preRegister, in which case 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.
      See Also:
    • unregisterMBean

      Unregisters an MBean from the MBean server. The MBean is identified by its object name. Once the method has been invoked, the MBean may no longer be accessed by its object name.
      Parameters:
      name - The object name of the MBean to be unregistered.
      Throws:
      InstanceNotFoundException - The MBean specified is not registered in the MBean server.