javax.management
Interface MBeanRegistration

All Known Implementing Classes:
CommunicatorServer, HtmlAdaptorServer, Monitor, MLet

public abstract interface MBeanRegistration

This interface can optionally be implemented by an MBean in order to carry out operations before and after being registered or de-registered from the MBeanServer.


Method Summary
 void postDeregister()
          Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.
 void postRegister(java.lang.Boolean registrationDone)
          Allows the MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.
 void preDeregister()
          Allows the MBean to perform any operations it needs before being de-registered by the MBeanServer.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Allows the MBean to perform any operations it needs before being registered in the MBeanServer.
 

Method Detail

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws java.lang.Exception
Allows the MBean to perform any operations it needs before being registered in the MBeanServer. If the name of the MBean is not specified, the MBean can provide a name for its registration. If any exception is raised, the MBean will not be registered in the MBeanServer.
Parameters:
server - The MBeanServer in which the MBean will be registered.
name - The object name of the MBean.
Returns:
The name of the MBean registered.
Throws:
java.langException - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Allows the MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBeanServer. The value false means that either the registration phase has failed.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Allows the MBean to perform any operations it needs before being de-registered by the MBeanServer.
Throws:
java.langException - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.