org.apache.catalina.mbeans

Class ServerLifecycleListener

Implemented Interfaces:
ContainerListener, LifecycleListener, PropertyChangeListener

public class ServerLifecycleListener
extends java.lang.Object
implements ContainerListener, LifecycleListener, PropertyChangeListener

Implementation of LifecycleListener that instantiates the set of MBeans associated with the components of a running instance of Catalina.

Version:
$Revision: 1.13 $ $Date: 2004/02/27 14:58:45 $

Authors:
Craig R. McClanahan
Amy Roh

Field Summary

protected String
adaptor
MX4J adaptor name.
protected String
adaptorHost
MX4J jrmp/iiop listen host
protected int
adaptorPort
MX4J jrmp/iiop listen port
protected int
debug
The debugging detail level for this component.
protected String
descriptors
Semicolon separated list of paths containing MBean desciptor resources.

Method Summary

void
containerEvent(ContainerEvent event)
Handle a ContainerEvent from one of the Containers we are interested in.
protected void
createMBeans()
Create the MBeans that correspond to every existing node of our tree.
protected void
createMBeans(Connector connector)
Create the MBeans for the specified Connector and its nested components.
protected void
createMBeans(Context context)
Create the MBeans for the specified Context and its nested components.
protected void
createMBeans(DefaultContext dcontext)
Create the MBeans for the specified DefaultContext and its nested components.
protected void
createMBeans(Engine engine)
Create the MBeans for the specified Engine and its nested components.
protected void
createMBeans(Host host)
Create the MBeans for the specified Host and its nested components.
protected void
createMBeans(Server server)
Create the MBeans for the specified Server and its nested components.
protected void
createMBeans(Service service)
Create the MBeans for the specified Service and its nested components.
protected void
createMBeans(ContextEnvironment environment)
Create the MBeans for the specified ContextEnvironment entry.
protected void
createMBeans(ContextResource resource)
Create the MBeans for the specified ContextResource entry.
protected void
createMBeans(ContextResourceLink resourceLink)
Create the MBeans for the specified ContextResourceLink entry.
protected void
createMBeans(NamingResources resources)
Create the MBeans for the specified NamingResources and its nested components.
protected void
createMBeans(MBeanFactory factory)
Create the MBeans for MBeanFactory.
protected void
destroyMBeans(Connector connector, Service service)
Deregister the MBeans for the specified Connector and its nested components.
protected void
destroyMBeans(Context context)
Deregister the MBeans for the specified Context and its nested components.
protected void
destroyMBeans(DefaultContext dcontext)
Deregister the MBeans for the specified DefaultContext and its nested components.
protected void
destroyMBeans(Engine engine)
Deregister the MBeans for the specified Engine and its nested components.
protected void
destroyMBeans(Host host)
Deregister the MBeans for the specified Host and its nested components.
protected void
destroyMBeans(Server server)
Deregister the MBeans for the specified Server and its related components.
protected void
destroyMBeans(Service service)
Deregister the MBeans for the specified Service and its nested components.
protected void
destroyMBeans(ContextEnvironment environment)
Deregister the MBeans for the specified ContextEnvironment entry.
protected void
destroyMBeans(ContextResource resource)
Deregister the MBeans for the specified ContextResource entry.
protected void
destroyMBeans(ContextResourceLink resourceLink)
Deregister the MBeans for the specified ContextResourceLink entry.
protected void
destroyMBeans(NamingResources resources)
Deregister the MBeans for the specified NamingResources and its nested components.
String
getAdaptor()
String
getAdaptorHost()
int
getAdaptorPort()
int
getDebug()
String
getDescriptors()
void
lifecycleEvent(LifecycleEvent event)
Primary entry point for startup and shutdown events.
protected void
loadMBeanDescriptors()
Load additional MBean descriptor resources.
protected void
log(String message)
Log a message.
protected void
log(String message, Throwable throwable)
Log a message and associated exception.
protected void
processContainerAddChild(Container parent, Container child)
Process the addition of a new child Container to a parent Container.
protected void
processContainerPropertyChange(Container container, String propertyName, Object oldValue, Object newValue)
Process a property change event on a Container.
protected void
processContainerRemoveChild(Container parent, Container child)
Process the removal of a child Container from a parent Container.
protected void
processDefaultContextPropertyChange(DefaultContext defaultContext, String propertyName, Object oldValue, Object newValue)
Process a property change event on a DefaultContext.
protected void
processNamingResourcesPropertyChange(NamingResources resources, String propertyName, Object oldValue, Object newValue)
Process a property change event on a NamingResources.
protected void
processServerPropertyChange(Server server, String propertyName, Object oldValue, Object newValue)
Process a property change event on a Server.
protected void
processServicePropertyChange(Service service, String propertyName, Object oldValue, Object newValue)
Process a property change event on a Service.
void
propertyChange(PropertyChangeEvent event)
Handle a PropertyChangeEvent from one of the Containers we are interested in.
void
setAdaptor(String adaptor)
void
setAdaptorHost(String adaptorHost)
void
setAdaptorPort(int adaptorPort)
void
setDebug(int debug)
void
setDescriptors(String descriptors)

Field Details

adaptor

protected String adaptor
MX4J adaptor name.


adaptorHost

protected String adaptorHost
MX4J jrmp/iiop listen host


adaptorPort

protected int adaptorPort
MX4J jrmp/iiop listen port


debug

protected int debug
The debugging detail level for this component.


descriptors

protected String descriptors
Semicolon separated list of paths containing MBean desciptor resources.

Method Details

containerEvent

public void containerEvent(ContainerEvent event)
Handle a ContainerEvent from one of the Containers we are interested in.
Specified by:
containerEvent in interface ContainerListener

Parameters:
event - The event that has occurred


createMBeans

protected void createMBeans()
Create the MBeans that correspond to every existing node of our tree.


createMBeans

protected void createMBeans(Connector connector)
            throws Exception
Create the MBeans for the specified Connector and its nested components.

Parameters:
connector - Connector for which to create MBeans


createMBeans

protected void createMBeans(Context context)
            throws Exception
Create the MBeans for the specified Context and its nested components.

Parameters:
context - Context for which to create MBeans


createMBeans

protected void createMBeans(DefaultContext dcontext)
            throws Exception
Create the MBeans for the specified DefaultContext and its nested components.

Parameters:
dcontext - DefaultContext for which to create MBeans


createMBeans

protected void createMBeans(Engine engine)
            throws Exception
Create the MBeans for the specified Engine and its nested components.

Parameters:
engine - Engine for which to create MBeans


createMBeans

protected void createMBeans(Host host)
            throws Exception
Create the MBeans for the specified Host and its nested components.

Parameters:
host - Host for which to create MBeans


createMBeans

protected void createMBeans(Server server)
            throws Exception
Create the MBeans for the specified Server and its nested components.

Parameters:
server - Server for which to create MBeans


createMBeans

protected void createMBeans(Service service)
            throws Exception
Create the MBeans for the specified Service and its nested components.

Parameters:
service - Service for which to create MBeans


createMBeans

protected void createMBeans(ContextEnvironment environment)
            throws Exception
Create the MBeans for the specified ContextEnvironment entry.

Parameters:
environment - ContextEnvironment for which to create MBeans


createMBeans

protected void createMBeans(ContextResource resource)
            throws Exception
Create the MBeans for the specified ContextResource entry.

Parameters:
resource - ContextResource for which to create MBeans


createMBeans

protected void createMBeans(ContextResourceLink resourceLink)
            throws Exception
Create the MBeans for the specified ContextResourceLink entry.

Parameters:
resourceLink - ContextResourceLink for which to create MBeans


createMBeans

protected void createMBeans(NamingResources resources)
            throws Exception
Create the MBeans for the specified NamingResources and its nested components.

Parameters:
resources - NamingResources for which to create MBeans


createMBeans

protected void createMBeans(MBeanFactory factory)
            throws Exception
Create the MBeans for MBeanFactory.

Parameters:
factory - MBeanFactory for which to create MBean


destroyMBeans

protected void destroyMBeans(Connector connector,
                             Service service)
            throws Exception
Deregister the MBeans for the specified Connector and its nested components.

Parameters:
connector - Connector for which to deregister MBeans


destroyMBeans

protected void destroyMBeans(Context context)
            throws Exception
Deregister the MBeans for the specified Context and its nested components.

Parameters:
context - Context for which to deregister MBeans


destroyMBeans

protected void destroyMBeans(DefaultContext dcontext)
            throws Exception
Deregister the MBeans for the specified DefaultContext and its nested components.

Parameters:
dcontext - DefaultContext for which to deregister MBeans


destroyMBeans

protected void destroyMBeans(Engine engine)
            throws Exception
Deregister the MBeans for the specified Engine and its nested components.

Parameters:
engine - Engine for which to destroy MBeans


destroyMBeans

protected void destroyMBeans(Host host)
            throws Exception
Deregister the MBeans for the specified Host and its nested components.

Parameters:
host - Host for which to destroy MBeans


destroyMBeans

protected void destroyMBeans(Server server)
            throws Exception
Deregister the MBeans for the specified Server and its related components.

Parameters:
server - Server for which to destroy MBeans


destroyMBeans

protected void destroyMBeans(Service service)
            throws Exception
Deregister the MBeans for the specified Service and its nested components.

Parameters:
service - Service for which to destroy MBeans


destroyMBeans

protected void destroyMBeans(ContextEnvironment environment)
            throws Exception
Deregister the MBeans for the specified ContextEnvironment entry.

Parameters:
environment - ContextEnvironment for which to destroy MBeans


destroyMBeans

protected void destroyMBeans(ContextResource resource)
            throws Exception
Deregister the MBeans for the specified ContextResource entry.

Parameters:
resource - ContextResource for which to destroy MBeans


destroyMBeans

protected void destroyMBeans(ContextResourceLink resourceLink)
            throws Exception
Deregister the MBeans for the specified ContextResourceLink entry.

Parameters:
resourceLink - ContextResourceLink for which to destroy MBeans


destroyMBeans

protected void destroyMBeans(NamingResources resources)
            throws Exception
Deregister the MBeans for the specified NamingResources and its nested components.

Parameters:
resources - NamingResources for which to destroy MBeans


getAdaptor

public String getAdaptor()


getAdaptorHost

public String getAdaptorHost()


getAdaptorPort

public int getAdaptorPort()


getDebug

public int getDebug()


getDescriptors

public String getDescriptors()


lifecycleEvent

public void lifecycleEvent(LifecycleEvent event)
Primary entry point for startup and shutdown events.
Specified by:
lifecycleEvent in interface LifecycleListener

Parameters:
event - The event that has occurred


loadMBeanDescriptors

protected void loadMBeanDescriptors()
Load additional MBean descriptor resources.


log

protected void log(String message)
Log a message.

Parameters:
message - The message to be logged


log

protected void log(String message,
                   Throwable throwable)
Log a message and associated exception.

Parameters:
message - The message to be logged
throwable - The exception to be logged


processContainerAddChild

protected void processContainerAddChild(Container parent,
                                        Container child)
Process the addition of a new child Container to a parent Container.

Parameters:
parent - Parent container
child - Child container


processContainerPropertyChange

protected void processContainerPropertyChange(Container container,
                                              String propertyName,
                                              Object oldValue,
                                              Object newValue)
            throws Exception
Process a property change event on a Container.

Parameters:
container - The container on which this event occurred
propertyName - The name of the property that changed
oldValue - The previous value (may be null)
newValue - The new value (may be null)


processContainerRemoveChild

protected void processContainerRemoveChild(Container parent,
                                           Container child)
Process the removal of a child Container from a parent Container.

Parameters:
parent - Parent container
child - Child container


processDefaultContextPropertyChange

protected void processDefaultContextPropertyChange(DefaultContext defaultContext,
                                                   String propertyName,
                                                   Object oldValue,
                                                   Object newValue)
            throws Exception
Process a property change event on a DefaultContext.

Parameters:
defaultContext - The DefaultContext on which this event occurred
propertyName - The name of the property that changed
oldValue - The previous value (may be null)
newValue - The new value (may be null)


processNamingResourcesPropertyChange

protected void processNamingResourcesPropertyChange(NamingResources resources,
                                                    String propertyName,
                                                    Object oldValue,
                                                    Object newValue)
            throws Exception
Process a property change event on a NamingResources.

Parameters:
resources - The global naming resources on which this event occurred
propertyName - The name of the property that changed
oldValue - The previous value (may be null)
newValue - The new value (may be null)


processServerPropertyChange

protected void processServerPropertyChange(Server server,
                                           String propertyName,
                                           Object oldValue,
                                           Object newValue)
            throws Exception
Process a property change event on a Server.

Parameters:
server - The server on which this event occurred
propertyName - The name of the property that changed
oldValue - The previous value (may be null)
newValue - The new value (may be null)


processServicePropertyChange

protected void processServicePropertyChange(Service service,
                                            String propertyName,
                                            Object oldValue,
                                            Object newValue)
            throws Exception
Process a property change event on a Service.

Parameters:
service - The service on which this event occurred
propertyName - The name of the property that changed
oldValue - The previous value (may be null)
newValue - The new value (may be null)


propertyChange

public void propertyChange(PropertyChangeEvent event)
Handle a PropertyChangeEvent from one of the Containers we are interested in.

Parameters:
event - The event that has occurred


setAdaptor

public void setAdaptor(String adaptor)


setAdaptorHost

public void setAdaptorHost(String adaptorHost)


setAdaptorPort

public void setAdaptorPort(int adaptorPort)


setDebug

public void setDebug(int debug)


setDescriptors

public void setDescriptors(String descriptors)


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.