Apache Tomcat 7.0.0

org.apache.catalina.util
Class LifecycleMBeanBase

java.lang.Object
  extended by org.apache.catalina.util.LifecycleBase
      extended by org.apache.catalina.util.LifecycleMBeanBase
All Implemented Interfaces:
MBeanRegistration, Lifecycle
Direct Known Subclasses:
Connector, ContainerBase, ManagerBase, RealmBase, StandardServer, StandardService, StandardThreadExecutor, ValveBase, WebappLoader

public abstract class LifecycleMBeanBase
extends LifecycleBase
implements MBeanRegistration


Field Summary
protected  MBeanServer mserver
           
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
LifecycleMBeanBase()
           
 
Method Summary
protected  void destroyInternal()
          Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.
 String getDomain()
          Obtain the domain under which this component will be / has been registered.
protected abstract  String getDomainInternal()
          Method implemented by sub-classes to identify the domain in which MBeans should be registered.
 ObjectName getObjectName()
          Obtain the name under which this component has been registered with JMX.
protected abstract  String getObjectNameKeyProperties()
          Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.
protected  void initInternal()
          Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.
 void postDeregister()
          Not used - NOOP.
 void postRegister(Boolean registrationDone)
          Not used - NOOP.
 void preDeregister()
          Not used - NOOP.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Allows the object to be registered with an alternative and/or ObjectName.
protected  ObjectName register(Object obj, String objectNameKeyProperties)
          Utility method to enable sub-classes to easily register additional components that don't implement LifecycleMBeanRegistration with an MBean server.
 void setDomain(String domain)
          Specify the domain under which this component should be registered.
protected  void unregister(ObjectName on)
          Utility method to enable sub-classes to easily unregister additional components that don't implement LifecycleMBeanRegistration with an MBean server.
 
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, init, removeLifecycleListener, setState, setState, start, startInternal, stop, stopInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mserver

protected MBeanServer mserver
Constructor Detail

LifecycleMBeanBase

public LifecycleMBeanBase()
Method Detail

initInternal

protected void initInternal()
                     throws LifecycleException
Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

Specified by:
initInternal in class LifecycleBase
Throws:
LifecycleException

destroyInternal

protected void destroyInternal()
                        throws LifecycleException
Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.

Specified by:
destroyInternal in class LifecycleBase
Throws:
LifecycleException

setDomain

public final void setDomain(String domain)
Specify the domain under which this component should be registered. Used with components that cannot (easily) navigate the component hierarchy to determine the correct domain to use.


getDomain

public final String getDomain()
Obtain the domain under which this component will be / has been registered.


getDomainInternal

protected abstract String getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans should be registered.

Returns:
The name of the domain to use to register MBeans.

getObjectName

public final ObjectName getObjectName()
Obtain the name under which this component has been registered with JMX.


getObjectNameKeyProperties

protected abstract String getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

Returns:
The string representation of the key properties component of the desired

register

protected final ObjectName register(Object obj,
                                    String objectNameKeyProperties)
Utility method to enable sub-classes to easily register additional components that don't implement LifecycleMBeanRegistration with an MBean server.
Note: This method can only be used once initInternal() has been called.

Parameters:
obj - The object the register
objectNameKeyProperties - The key properties component of the object name to use to register the object
Returns:
The name used to register the object

unregister

protected final void unregister(ObjectName on)
Utility method to enable sub-classes to easily unregister additional components that don't implement LifecycleMBeanRegistration with an MBean server.

Parameters:
on - The name of the component to unregister

postDeregister

public final void postDeregister()
Not used - NOOP.

Specified by:
postDeregister in interface MBeanRegistration

postRegister

public final void postRegister(Boolean registrationDone)
Not used - NOOP.

Specified by:
postRegister in interface MBeanRegistration

preDeregister

public final void preDeregister()
                         throws Exception
Not used - NOOP.

Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

preRegister

public final ObjectName preRegister(MBeanServer server,
                                    ObjectName name)
                             throws Exception
Allows the object to be registered with an alternative and/or ObjectName.

Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

Apache Tomcat 7.0.0

Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.