org.kuali.rice.core.web.jetty
Class JettyServer
java.lang.Object
org.kuali.rice.core.web.jetty.JettyServer
- All Implemented Interfaces:
- Lifecycle
public class JettyServer
- extends Object
- implements Lifecycle
LOG
private static final org.apache.log4j.Logger LOG
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
port
private int port
contextName
private String contextName
relativeWebappRoot
private String relativeWebappRoot
servletClass
private Class servletClass
server
private org.mortbay.jetty.Server server
context
private org.mortbay.jetty.servlet.Context context
failOnContextFailure
private boolean failOnContextFailure
testMode
private boolean testMode
- Whether we are in test mode
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)
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()
useWebAppContext
private boolean useWebAppContext()
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-2011 The Kuali Foundation. All Rights Reserved.