public abstract class Container extends Object implements LifeCycle, EventProvider, Serializable
| Constructor and Description |
|---|
Container() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponent(Object o) |
void |
addEventListener(EventListener listener)
Add a server event listener.
|
void |
destroy()
Destroy a stopped server.
|
protected abstract void |
doStart()
Do start operations.
|
protected abstract void |
doStop()
Do stop operations.
|
Collection |
getComponents() |
boolean |
isStarted() |
protected boolean |
isStarting() |
protected boolean |
isStopping() |
protected void |
removeComponent(Object o) |
void |
removeEventListener(EventListener listener) |
void |
start()
Start the server.
|
void |
stop()
Stop the container.
|
public final void start()
throws Exception
protected abstract void doStart()
throws Exception
Exceptionpublic boolean isStarted()
protected boolean isStarting()
protected boolean isStopping()
public final void stop()
throws InterruptedException
stop in interface LifeCycleInterruptedException - Stopping a lifecycle is rarely atomic
and may be interrupted by another thread. If this happens
InterruptedException is throw and the component will be in an
indeterminant state and should probably be discarded.protected abstract void doStop()
throws Exception
Exceptionprotected void addComponent(Object o)
protected void removeComponent(Object o)
public void addEventListener(EventListener listener) throws IllegalArgumentException
addEventListener in interface EventProviderlistener - ComponentEventListener or LifeCycleEventListenerIllegalArgumentException - If the EventListener type is not supported.public void removeEventListener(EventListener listener)
removeEventListener in interface EventProviderpublic void destroy()
public Collection getComponents()
Copyright © 2013. All rights reserved.