FileDocCategorySizeDatePackage
CustomMBeanRegistration.javaAPI DocGlassfish v2 API5576Fri May 04 22:33:46 BST 2007com.sun.enterprise.admin.server.core

CustomMBeanRegistration

public interface CustomMBeanRegistration
Defines the behavior to register MBeans in an MBeanServer.

Fields Summary
Constructors Summary
Methods Summary
public javax.management.ObjectNameregisterMBean(com.sun.enterprise.config.serverbeans.Mbean mbd)
Registers an MBean per the given MBean definition in an MBeanServer of implementation choice. Registration process involves loading of MBean Class by a class-loader of implementation choice, instantiating it, registering it in the MBeanServer and initializing it if the configuration (MBeanDefinition) has it. If the initialization of the MBean fails, a RuntimeException is thrown and the MBean is deregistered if it was registered. Appropriate exceptions are available in the stack of the exceptions at every stage during registration, as follows:
  • ClassNotFoundException, NoClassDefFoundError if the class could not be loaded
  • ExceptionInInitializerError, IllegalAccessException, InstantiationException if the MBean instance could not be created
  • Standard attribute setting exceptions from MBeanServer's setAttribute(Attribute, Object) contract
The initialization is done using several calls to setAttribute(Attribute, Object) on the MBeanServer so as to know setting what attribute causes a problem, if any.

return
ObjectName with which the MBean is going to be actually registered. If the Mbean definition given is not enabled, a null is returned

public voidregisterMBeans(java.util.List mbeans)
Registers all the Mbeans in the given List of @link{Mbean} instances. Following is the contract of this method:
  • The given List must be non-null, an InvalidArgumentException is thrown otherwise
  • Only the MBeans that are enabled are registered in MBeanServer
  • Continues to load rest of the Mbeans if registration for one of them fails
  • Never throws an Exception if the given List is non-null

param
mbeans a list of MBeans to register, the list will be traversed serially
throws
CustomMBeanException if the param is null

public voidregisterMBeans(java.util.List mbeans, boolean continueReg)
Registers all the Mbeans in the given List of @link{Mbean} instances. Following is the contract of this method:
  • Degenerates to registerMBeans(mbeans) if param continueReg is true
  • If continueReg is false and there is any problem with registering an MBean in the given List, a CustomMBeanException is thrown
  • param
    mbeans a List of MBeans to register
    param
    continueReg a boolean to control the behavior of registration

public voidsetClassLoader(java.lang.ClassLoader cl)
Sets the ClassLoader instance that would be used in loading of MBean Class from this point onwards. This will affect the behavior of the implementing class once invoked because all the subsequent registration calls will use the given instance of ClassLoader. When set, this class-loader is used as the initiating class loader of the MBean Classes.

param
cl ClassLoader instance to use, must be non-null
throws
IllegalArgumentException if the given class-loader is null