org.mortbay.util

Class Container

public abstract class Container extends Object implements LifeCycle, EventProvider, Serializable

Abstract Container. Provides base handling for LifeCycle and Component events.

Version: $Id: Container.java,v 1.4 2005/08/13 08:49:59 gregwilkins Exp $

Author: Greg Wilkins (gregw)

Method Summary
protected voidaddComponent(Object o)
voidaddEventListener(EventListener listener)
Add a server event listener.
voiddestroy()
Destroy a stopped server.
protected abstract voiddoStart()
Do start operations.
protected abstract voiddoStop()
Do stop operations.
CollectiongetComponents()
booleanisStarted()
protected booleanisStarting()
protected booleanisStopping()
protected voidremoveComponent(Object o)
voidremoveEventListener(EventListener listener)
voidstart()
Start the server.
voidstop()
Stop the container.

Method Detail

addComponent

protected void addComponent(Object o)

addEventListener

public void addEventListener(EventListener listener)
Add a server event listener.

Parameters: listener ComponentEventListener or LifeCycleEventListener

destroy

public void destroy()
Destroy a stopped server. Remove all components and send notifications to all event listeners. The HttpServer must be stopped before it can be destroyed.

doStart

protected abstract void doStart()
Do start operations. This abstract method is called by start to perform the actual start operations.

doStop

protected abstract void doStop()
Do stop operations. This abstract method is called by stop to perform the actual stop operations.

getComponents

public Collection getComponents()

isStarted

public boolean isStarted()

isStarting

protected boolean isStarting()

isStopping

protected boolean isStopping()

removeComponent

protected void removeComponent(Object o)

removeEventListener

public void removeEventListener(EventListener listener)

start

public final void start()
Start the server. Generate LifeCycleEvents for starting and started either side of a call to doStart

stop

public final void stop()
Stop the container. Generate LifeCycleEvents for stopping and stopped either side of a call to doStop
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.