Can be implemented by an MBean in order to carry out operations before and after being registered or unregistered from the MBean Server. An MBean can also implement this interface in order to get a reference to the MBean Server and/or its name within that MBean Server.
1.5
- Method from javax.management.MBeanRegistration Summary: |
---|
postDeregister, postRegister, preDeregister, preRegister |
Method from javax.management.MBeanRegistration Detail: |
---|
If the implementation of this method throws a RuntimeException or an Error , the MBean Server will rethrow those inside a RuntimeMBeanException or RuntimeErrorException , respectively. However, throwing an exception in {@code postDeregister} will not change the state of the MBean: the MBean was already successfully deregistered and will remain so. This might be confusing for the code calling {@code unregisterMBean()}, as it might assume that MBean deregistration has failed. Therefore it is recommended that implementations of {@code postDeregister} do not throw Runtime Exceptions or Errors if it can be avoided. |
If the implementation of this method throws a RuntimeException or an Error , the MBean Server will rethrow those inside a RuntimeMBeanException or RuntimeErrorException , respectively. However, throwing an exception in {@code postRegister} will not change the state of the MBean: if the MBean was already registered ({@code registrationDone} is {@code true}), the MBean will remain registered. This might be confusing for the code calling {@code createMBean()} or {@code registerMBean()}, as such code might assume that MBean registration has failed when such an exception is raised. Therefore it is recommended that implementations of {@code postRegister} do not throw Runtime Exceptions or Errors if it can be avoided. |
|
|