javax.management
Interface MBeanRegistration


public interface MBeanRegistration

Beans may implement this interface in order to perform operations immediately prior to or after their registration or deregistration.

Since:
1.5

Method Summary
 void postDeregister()
          This method is called following deregistration of the bean by the server.
 void postRegister(Boolean successful)
          This method is called following both successful and unsuccessful attempts to register the bean.
 void preDeregister()
          This method is called prior to de-registration, and may throw an exception.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          This method is called prior to registration, with a reference to the server and ObjectName supplied to the server for registration.
 

Method Detail

postDeregister

void postDeregister()
This method is called following deregistration of the bean by the server.


postRegister

void postRegister(Boolean successful)
This method is called following both successful and unsuccessful attempts to register the bean. The supplied boolean value indicates the result of the attempt relative to this call.

Parameters:
successful - true if the registration was successful.

preDeregister

void preDeregister()
                   throws Exception
This method is called prior to de-registration, and may throw an exception.

Throws:
Exception - if something goes wrong during the bean's pre-deregistration operation. The server will re-throw this exception as an MBeanRegistrationException.

preRegister

ObjectName preRegister(MBeanServer server,
                       ObjectName name)
                       throws Exception
This method is called prior to registration, with a reference to the server and ObjectName supplied to the server for registration. This method may be used to replace this name by one chosen by the bean. Such behaviour is expected if the supplied name is null, but may occur in all cases. The method may throw an exception, which will cause registration to be aborted.

Parameters:
server - the server with which the bean is being registered.
name - the name the server was supplied with for registration, which may be null.
Throws:
Exception - if something goes wrong during the bean's pre-registration operation. The server will re-throw this exception as an MBeanRegistrationException.