javax.management
Interface MBeanRegistration

All Known Subinterfaces:
Detector (src) , JNDIDetectorMBean (src) , MBeanInvoker (src) , MulticastDetectorMBean (src) , NetworkRegistryMBean (src) , SharedInterceptor (src)
All Known Implementing Classes:
AbstractDetector (src) , AbstractMBeanInvoker (src) , AbstractSharedInterceptor (src) , AOPTester (src) , AxisService (src) , BeanCacheMonitor (src) , BuilderTest (src) , CacheTester (src) , Connector (src) , DerbyDatabase (src) , DestinationMBeanSupport (src) , HypersonicDatabase (src) , JNDIDetector (src) , JRMPInvoker (src) , LockedTest (src) , LockedTest2 (src) , LockedTest3 (src) , MessageCache (src) , MLet (src) , Monitor (src) , MulticastDetector (src) , NetworkRegistry (src) , RegistrationAware (src) , RegistrationAware (src) , RelationService (src) , RelationSupport (src) , RemotingTester (src) , RequiredModelMBean (src) , SecurityTester (src) , ServerInfo (src) , ServerInterceptorChain (src) , ServiceBindingManager (src) , ServiceController (src) , ServiceMBeanSupport (src) , SimpleBeanTester (src) , SnapshotRecordingMonitor (src) , StandardService (src) , Test2 (src) , Test3 (src) , Test4 (src) , Timer (src) , TxLockTester (src) , TxTester (src) , UnifiedLoaderRepository3 (src) , VersionedObjectTester (src)

public interface MBeanRegistration

This interface is implemented by an MBean that wants to perform operations pre and post registration and deregistration.

The preRegister method is called by the MBeanServer before registration.

The postRegister method is called by the MBeanServer after registration.

The preDeregister method is called by the MBeanServer before deregistration.

The postDeregister method is called by the MBeanServer after deregistration.


Method Summary
 void postDeregister()
          This method is called by the MBeanServer after deregistration takes place.
 void postRegister(java.lang.Boolean registrationDone)
          This method is called by the MBeanServer after registration takes place or when registration fails.
 void preDeregister()
          This method is called by the MBeanServer before deregistration takes place.
 ObjectName (src) preRegister(MBeanServer (src)  server, ObjectName (src)  name)
          This method is called by the MBeanServer before registration takes place.
 

Method Detail

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  server,
                              ObjectName (src)  name)
                       throws java.lang.Exception
This method is called by the MBeanServer before registration takes place. The MBean is passed a reference of the MBeanServer it is about to be registered with. The MBean must return the ObjectName it will be registered with. The MBeanServer can pass a suggested object depending upon how the MBean is registered.

The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Returns:
the actual ObjectName to register this MBean with.
Throws:
java.lang.Exception - for any error, the MBean is not registered.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
This method is called by the MBeanServer after registration takes place or when registration fails.

Parameters:
registrationDone - the MBeanServer passes true when the MBean was registered, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
This method is called by the MBeanServer before deregistration takes place.

The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Throws:
java.lang.Exception

postDeregister

public void postDeregister()
This method is called by the MBeanServer after deregistration takes place.