net.sf.ooweb.http
Class AbstractServer

java.lang.Object
  extended by net.sf.ooweb.http.AbstractServer
All Implemented Interfaces:
Server
Direct Known Subclasses:
OowebServer

public abstract class AbstractServer
extends java.lang.Object
implements Server

AbstractServer is a superclass for Ooweb servers allowing subclasses to build on existing HTTP server architectures.

Since:
0.7
Author:
Darren Davison

Field Summary
protected static java.lang.String DEFAULT_QUIP
           
protected  java.util.logging.Logger logger
           
protected static java.lang.String QUIP_FILE
           
protected static java.util.List<java.lang.String> quipList
           
 
Constructor Summary
AbstractServer()
           
 
Method Summary
 void addController(java.lang.Object object)
          Register a controller.
static Cache getCache()
          return the cache implementation in use
protected  java.lang.String getQuip()
          Returns a random quip for the startup message.
static Registry getRegistry()
          Return the object registry
protected static Cache initialiseCache()
          subclasses should override to provide a concrete inplementation of the Cache interface that will be used by this server.
 void setControllers(java.util.List controllers)
          Register a List of controllers, each of which must carry the @Controller annotation at the class level
 void start()
          subclasses usually will want to override this method to actually start the server.
 void stop()
          subclasses can optionally override the stop method to shutdown the server gracefully.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final java.util.logging.Logger logger

DEFAULT_QUIP

protected static final java.lang.String DEFAULT_QUIP
See Also:
Constant Field Values

QUIP_FILE

protected static final java.lang.String QUIP_FILE
See Also:
Constant Field Values

quipList

protected static final java.util.List<java.lang.String> quipList
Constructor Detail

AbstractServer

public AbstractServer()
Method Detail

start

public void start()
           throws java.lang.Exception
subclasses usually will want to override this method to actually start the server. The implementation here is empty.

Specified by:
start in interface Server
Throws:
java.lang.Exception
See Also:
Server.start()

stop

public void stop()
subclasses can optionally override the stop method to shutdown the server gracefully. The implementation here does nothing

Specified by:
stop in interface Server
See Also:
Server.stop()

getCache

public static final Cache getCache()
return the cache implementation in use

Returns:
the Cache implementation used in this server

initialiseCache

protected static Cache initialiseCache()
subclasses should override to provide a concrete inplementation of the Cache interface that will be used by this server.

Returns:
the initialised Cache implementation to be used by this server

getRegistry

public static Registry getRegistry()
Return the object registry

Returns:
the object registry for this application

setControllers

public void setControllers(java.util.List controllers)
Register a List of controllers, each of which must carry the @Controller annotation at the class level

Specified by:
setControllers in interface Server
See Also:
Server.setControllers(java.util.List)

addController

public void addController(java.lang.Object object)
Register a controller. This object must carry the @Controller annotation at the class level.

Specified by:
addController in interface Server

getQuip

protected java.lang.String getQuip()
Returns a random quip for the startup message.

Returns:
a quip


Copyright (C) 2005-2007 OOWeb Authors.