Class TomcatEventHandlerAdapter
- java.lang.Object
-
- org.jboss.modcluster.container.tomcat.TomcatEventHandlerAdapter
-
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,org.apache.catalina.ContainerListener
,org.apache.catalina.LifecycleListener
,TomcatEventHandler
public class TomcatEventHandlerAdapter extends Object implements TomcatEventHandler
Adapts lifecycle and container listener events to theContainerEventHandler
interface.- Author:
- Paul Ferraro, Radoslav Husar
-
-
Field Summary
Fields Modifier and Type Field Description protected ContainerEventHandler
eventHandler
protected AtomicBoolean
init
protected TomcatRegistry
registry
protected ServerProvider
serverProvider
protected AtomicBoolean
start
-
Constructor Summary
Constructors Constructor Description TomcatEventHandlerAdapter(ContainerEventHandler eventHandler, TomcatConnectorConfiguration connectorConfiguration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addListeners(org.apache.catalina.Server server)
void
containerEvent(org.apache.catalina.ContainerEvent event)
Acknowledge the occurrence of the specified event.protected void
destroy(org.apache.catalina.Server server)
protected void
init(org.apache.catalina.Server server)
protected boolean
isAfterInit(org.apache.catalina.LifecycleEvent event)
protected boolean
isBeforeDestroy(org.apache.catalina.LifecycleEvent event)
void
lifecycleEvent(org.apache.catalina.LifecycleEvent event)
Primary entry point for startup and shutdown events.void
propertyChange(PropertyChangeEvent event)
protected void
removeListeners(org.apache.catalina.Server server)
void
start()
void
stop()
protected static ObjectName
toObjectName(String name)
-
-
-
Field Detail
-
eventHandler
protected final ContainerEventHandler eventHandler
-
serverProvider
protected final ServerProvider serverProvider
-
registry
protected final TomcatRegistry registry
-
init
protected final AtomicBoolean init
-
start
protected final AtomicBoolean start
-
-
Constructor Detail
-
TomcatEventHandlerAdapter
public TomcatEventHandlerAdapter(ContainerEventHandler eventHandler, TomcatConnectorConfiguration connectorConfiguration)
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceTomcatEventHandler
-
stop
public void stop()
- Specified by:
stop
in interfaceTomcatEventHandler
-
containerEvent
public void containerEvent(org.apache.catalina.ContainerEvent event)
Acknowledge the occurrence of the specified event. Note: Will never be called when the listener is associated to a Server, since it is not a Container.- Specified by:
containerEvent
in interfaceorg.apache.catalina.ContainerListener
-
lifecycleEvent
public void lifecycleEvent(org.apache.catalina.LifecycleEvent event)
Primary entry point for startup and shutdown events. Handles both situations where Listener is defined on either a top-level Server concept or Service in which case only the associated service is handled.- Specified by:
lifecycleEvent
in interfaceorg.apache.catalina.LifecycleListener
-
isAfterInit
protected boolean isAfterInit(org.apache.catalina.LifecycleEvent event)
-
isBeforeDestroy
protected boolean isBeforeDestroy(org.apache.catalina.LifecycleEvent event)
-
init
protected void init(org.apache.catalina.Server server)
-
destroy
protected void destroy(org.apache.catalina.Server server)
-
addListeners
protected void addListeners(org.apache.catalina.Server server)
-
removeListeners
protected void removeListeners(org.apache.catalina.Server server)
-
toObjectName
protected static ObjectName toObjectName(String name)
-
propertyChange
public void propertyChange(PropertyChangeEvent event)
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
-