net.commerce.zocalo.service
Class ServletUtil

java.lang.Object
  extended by net.commerce.zocalo.service.ServerUtil
      extended by net.commerce.zocalo.service.ServletUtil
Direct Known Subclasses:
CometServer, ConfigManager

public abstract class ServletUtil
extends ServerUtil

utility functionality for webservers based on servlets. Particularly notice that the servletLock is used to ensure that the market code is non-reentrant.


Field Summary
static java.lang.Object servletLock
           
 
Fields inherited from class net.commerce.zocalo.service.ServerUtil
DEFAULT_DB_FILE_KEY, DEFAULT_DB_URL_KEY
 
Constructor Summary
ServletUtil()
           
 
Method Summary
 void addContextHandlers(boolean installCGI)
           
protected  void addExtraResourceHandlers(org.mortbay.jetty.handler.ContextHandlerCollection handlers)
           
protected  org.mortbay.jetty.handler.ResourceHandler addResourceHandler(org.mortbay.jetty.handler.HandlerCollection handlers, java.lang.String path, java.lang.String base)
           
protected static void addServlet(org.mortbay.jetty.servlet.ServletHandler handler, java.lang.String servletName)
           
abstract  void addServlets(org.mortbay.jetty.servlet.Context context)
           
protected static org.mortbay.jetty.Server createServerWithListener(java.lang.String serverPort)
           
 void finishInitialization()
           
protected  void initializeHandlers(boolean installCGI)
           
protected  void initializeServerTopLevel(java.lang.String serverPort)
           
protected  void initializeServerTopLevel(java.lang.String serverPort, boolean installCGI)
           
protected  void initializeServerTopLevelWithCGI(java.lang.String serverPort)
           
protected  void initialLogContext()
           
protected  void join()
           
protected static void runJettyServer(ServletUtil server)
           
protected  void start()
           
 
Methods inherited from class net.commerce.zocalo.service.ServerUtil
readConfigFile, readDBConfigFromProps
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servletLock

public static final java.lang.Object servletLock
Constructor Detail

ServletUtil

public ServletUtil()
Method Detail

initialLogContext

protected void initialLogContext()

createServerWithListener

protected static org.mortbay.jetty.Server createServerWithListener(java.lang.String serverPort)

addServlet

protected static void addServlet(org.mortbay.jetty.servlet.ServletHandler handler,
                                 java.lang.String servletName)

initializeHandlers

protected void initializeHandlers(boolean installCGI)

addResourceHandler

protected org.mortbay.jetty.handler.ResourceHandler addResourceHandler(org.mortbay.jetty.handler.HandlerCollection handlers,
                                                                       java.lang.String path,
                                                                       java.lang.String base)

addContextHandlers

public void addContextHandlers(boolean installCGI)

addExtraResourceHandlers

protected void addExtraResourceHandlers(org.mortbay.jetty.handler.ContextHandlerCollection handlers)

addServlets

public abstract void addServlets(org.mortbay.jetty.servlet.Context context)

initializeServerTopLevel

protected void initializeServerTopLevel(java.lang.String serverPort)

initializeServerTopLevelWithCGI

protected void initializeServerTopLevelWithCGI(java.lang.String serverPort)

initializeServerTopLevel

protected void initializeServerTopLevel(java.lang.String serverPort,
                                        boolean installCGI)

runJettyServer

protected static void runJettyServer(ServletUtil server)
                              throws java.lang.Exception
Throws:
java.lang.Exception

finishInitialization

public void finishInitialization()

join

protected void join()
             throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

start

protected void start()
              throws java.lang.Exception
Throws:
java.lang.Exception