CustomMBeanRegistrationpublic interface CustomMBeanRegistration Defines the behavior to register MBeans in an MBeanServer. |
Methods Summary |
---|
public javax.management.ObjectName | registerMBean(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.
| public void | registerMBeans(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
| public void | registerMBeans(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
| public void | setClassLoader(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.
|
|