org.kuali.rice.core.web.jetty
Class JettyServer

java.lang.Object
  extended by org.kuali.rice.core.web.jetty.JettyServer
All Implemented Interfaces:
Lifecycle

public class JettyServer
extends Object
implements Lifecycle


Field Summary
static String JETTYSERVER_TESTMODE_ATTRIB
          The name of an attribute we set in the ServletContext to indicate to the webapp that it is running within unit tests, in case it needs to alter its configuration or behavior.
 
Constructor Summary
JettyServer()
           
JettyServer(int port)
           
JettyServer(int port, String contextName)
           
JettyServer(int port, String contextName, Class servletClass)
           
JettyServer(int port, String contextName, String relativeWebappRoot)
           
JettyServer(int port, String contextName, String relativeWebappRoot, Class servletClass)
           
 
Method Summary
protected  boolean contextStartupFailed()
          A hack for Jetty so that we can detect if context startup failed.
protected  org.mortbay.jetty.Server createServer()
           
 org.mortbay.jetty.servlet.Context getContext()
           
 String getContextName()
           
 int getPort()
           
 String getRelativeWebappRoot()
           
 org.mortbay.jetty.Server getServer()
           
 boolean isFailOnContextFailure()
           
 boolean isStarted()
           
 boolean isTestMode()
           
static void main(String[] args)
           
protected  void setBaseDirSystemProperty()
           
 void setContextName(String contextName)
           
 void setFailOnContextFailure(boolean failOnContextFailure)
           
 void setPort(int port)
           
 void setRelativeWebappRoot(String relativeWebappRoot)
           
 void setTestMode(boolean t)
           
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JETTYSERVER_TESTMODE_ATTRIB

public static final String JETTYSERVER_TESTMODE_ATTRIB
The name of an attribute we set in the ServletContext to indicate to the webapp that it is running within unit tests, in case it needs to alter its configuration or behavior.

See Also:
Constant Field Values
Constructor Detail

JettyServer

public JettyServer()

JettyServer

public JettyServer(int port)

JettyServer

public JettyServer(int port,
                   String contextName)

JettyServer

public JettyServer(int port,
                   String contextName,
                   String relativeWebappRoot)

JettyServer

public JettyServer(int port,
                   String contextName,
                   Class servletClass)

JettyServer

public JettyServer(int port,
                   String contextName,
                   String relativeWebappRoot,
                   Class servletClass)
Method Detail

setTestMode

public void setTestMode(boolean t)

isTestMode

public boolean isTestMode()

getServer

public org.mortbay.jetty.Server getServer()

getContext

public org.mortbay.jetty.servlet.Context getContext()

start

public void start()
           throws Exception
Specified by:
start in interface Lifecycle
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Lifecycle
Throws:
Exception

isStarted

public boolean isStarted()
Specified by:
isStarted in interface Lifecycle

createServer

protected org.mortbay.jetty.Server createServer()

setBaseDirSystemProperty

protected void setBaseDirSystemProperty()

contextStartupFailed

protected boolean contextStartupFailed()
                                throws Exception
A hack for Jetty so that we can detect if context startup failed. Jetty has no programatic way available to detect if context startup failed. Instead we have to use reflection to check the value of a private variable. See http://jira.codehaus.org/browse/JETTY-319 for more details on the issue.

Throws:
Exception

getRelativeWebappRoot

public String getRelativeWebappRoot()

setRelativeWebappRoot

public void setRelativeWebappRoot(String relativeWebappRoot)

getContextName

public String getContextName()

setContextName

public void setContextName(String contextName)

getPort

public int getPort()

setPort

public void setPort(int port)

isFailOnContextFailure

public boolean isFailOnContextFailure()

setFailOnContextFailure

public void setFailOnContextFailure(boolean failOnContextFailure)

toString

public String toString()
Overrides:
toString in class Object

main

public static void main(String[] args)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.