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
voidpostDeregister()
This method is called following deregistration of the bean by the server.
voidpostRegister(Boolean successful)
This method is called following both successful and unsuccessful attempts to register the bean.
voidpreDeregister()
This method is called prior to de-registration, and may throw an exception.
ObjectNamepreRegister(MBeanServer server, ObjectName name)
This method is called prior to registration, with a reference to the server and {@link ObjectName} supplied to the server for registration.

Method Detail

postDeregister

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

postRegister

public 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

public void preDeregister()
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 {@link MBeanRegistrationException}.

preRegister

public ObjectName preRegister(MBeanServer server, ObjectName name)
This method is called prior to registration, with a reference to the server and {@link 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 {@link MBeanRegistrationException}.