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
Exception
public boolean isStarted()
protected boolean isStarting()
protected boolean isStopping()
public final void stop() throws InterruptedException
stop
in interface LifeCycle
InterruptedException
- 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
Exception
protected void addComponent(Object o)
protected void removeComponent(Object o)
public void addEventListener(EventListener listener) throws IllegalArgumentException
addEventListener
in interface EventProvider
listener
- ComponentEventListener or LifeCycleEventListenerIllegalArgumentException
- If the EventListener type is not supported.public void removeEventListener(EventListener listener)
removeEventListener
in interface EventProvider
public void destroy()
public Collection getComponents()
Copyright © 2013. All rights reserved.