|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openqa.jetty.util.Container org.openqa.jetty.http.HttpServer org.openqa.jetty.jetty.Server
public class Server
The Jetty HttpServer. This specialization of org.openqa.jetty.http.HttpServer adds knowledge about servlets and their specialized contexts. It also included support for initialization from xml configuration files that follow the XmlConfiguration dtd. HttpContexts created by Server are of the type org.openqa.jetty.jetty.servlet.ServletHttpContext unless otherwise specified. This class also provides a main() method which starts a server for each config file passed on the command line. If the system property JETTY_NO_SHUTDOWN_HOOK is not set to true, then a shutdown hook is thread is registered to stop these servers.
XmlConfiguration
,
ServletHttpContext
,
Serialized FormConstructor Summary | |
---|---|
Server()
Constructor. |
|
Server(Resource configuration)
Constructor. |
|
Server(java.lang.String configuration)
Constructor. |
|
Server(java.net.URL configuration)
Constructor. |
Method Summary | |
---|---|
WebApplicationContext |
addWebApplication(java.lang.String contextPathSpec,
java.lang.String webApp)
Add Web Application. |
WebApplicationContext |
addWebApplication(java.lang.String virtualHost,
java.lang.String contextPathSpec,
java.lang.String webApp)
Add Web Application. |
WebApplicationContext[] |
addWebApplications(java.lang.String webapps)
Add Web Applications. |
WebApplicationContext[] |
addWebApplications(java.lang.String host,
java.lang.String webapps)
Add Web Applications. |
WebApplicationContext[] |
addWebApplications(java.lang.String host,
java.lang.String webapps,
boolean extract)
Add Web Applications. |
WebApplicationContext[] |
addWebApplications(java.lang.String host,
java.lang.String webapps,
java.lang.String defaults,
boolean extract)
Add Web Applications. |
WebApplicationContext[] |
addWebApplications(java.lang.String host,
java.lang.String webapps,
java.lang.String defaults,
boolean extract,
boolean java2CompliantClassLoader)
Add Web Applications. |
void |
configure(java.lang.String configuration)
Configure the server from an XML file. |
java.lang.String |
getConfiguration()
|
java.lang.String |
getRootWebApp()
Get the root webapp name. |
boolean |
getStopAtShutdown()
|
java.lang.String[] |
getWebApplicationConfigurationClassNames()
|
static void |
main(java.lang.String[] arg)
|
protected HttpContext |
newHttpContext()
Create a new ServletHttpContext. |
protected WebApplicationContext |
newWebApplicationContext(java.lang.String webApp)
Create a new WebApplicationContext. |
void |
setRootWebApp(java.lang.String rootWebApp)
Set the root webapp name. |
void |
setStopAtShutdown(boolean stop)
|
void |
setWebApplicationConfigurationClassNames(java.lang.String[] configurationClassNames)
setWebApplicationConfigurationClasses Set up the list of classnames of WebApplicationContext.Configuration implementations that will be applied to configure every webapp. |
Methods inherited from class org.openqa.jetty.util.Container |
---|
addComponent, addEventListener, getComponents, isStarted, isStarting, isStopping, removeComponent, removeEventListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.openqa.jetty.util.LifeCycle |
---|
isStarted, start, stop |
Methods inherited from interface org.openqa.jetty.util.EventProvider |
---|
addEventListener, removeEventListener |
Constructor Detail |
---|
public Server()
public Server(java.lang.String configuration) throws java.io.IOException
configuration
- The filename or URL of the XML
configuration file.
java.io.IOException
public Server(Resource configuration) throws java.io.IOException
configuration
- The filename or URL of the XML
configuration file.
java.io.IOException
public Server(java.net.URL configuration) throws java.io.IOException
configuration
- The filename or URL of the XML
configuration file.
java.io.IOException
Method Detail |
---|
public boolean getStopAtShutdown()
public void setStopAtShutdown(boolean stop)
public java.lang.String getRootWebApp()
public void setRootWebApp(java.lang.String rootWebApp)
rootWebApp
- The name of the root webapp (eg. "root" for root.war).public void configure(java.lang.String configuration) throws java.io.IOException
configuration
- The filename or URL of the XML
configuration file.
java.io.IOException
public java.lang.String getConfiguration()
protected HttpContext newHttpContext()
newHttpContext
in class HttpServer
protected WebApplicationContext newWebApplicationContext(java.lang.String webApp)
webApp
- The Web application directory or WAR file.
public WebApplicationContext addWebApplication(java.lang.String contextPathSpec, java.lang.String webApp) throws java.io.IOException
contextPathSpec
- The context path spec. Which must be of
the form / or /path/*webApp
- The Web application directory or WAR file.
java.io.IOException
public WebApplicationContext addWebApplication(java.lang.String virtualHost, java.lang.String contextPathSpec, java.lang.String webApp) throws java.io.IOException
virtualHost
- Virtual host name or nullcontextPathSpec
- The context path spec. Which must be of
the form / or /path/*webApp
- The Web application directory or WAR file.
java.io.IOException
public WebApplicationContext[] addWebApplications(java.lang.String webapps) throws java.io.IOException
webapps
- Directory file name or URL to look for auto webapplication.
java.io.IOException
public WebApplicationContext[] addWebApplications(java.lang.String host, java.lang.String webapps) throws java.io.IOException
host
- Virtual host name or nullwebapps
- Directory file name or URL to look for auto webapplication.
java.io.IOException
public WebApplicationContext[] addWebApplications(java.lang.String host, java.lang.String webapps, boolean extract) throws java.io.IOException
host
- Virtual host name or nullwebapps
- Directory file name or URL to look for auto
webapplication.extract
- If true, extract war files
java.io.IOException
public WebApplicationContext[] addWebApplications(java.lang.String host, java.lang.String webapps, java.lang.String defaults, boolean extract) throws java.io.IOException
host
- Virtual host name or nullwebapps
- Directory file name or URL to look for auto
webapplication.defaults
- The defaults xml filename or URL which is
loaded before any in the web app. Must respect the web.dtd.
If null the default defaults file is used. If the empty string, then
no defaults file is used.extract
- If true, extract war files
java.io.IOException
public WebApplicationContext[] addWebApplications(java.lang.String host, java.lang.String webapps, java.lang.String defaults, boolean extract, boolean java2CompliantClassLoader) throws java.io.IOException
host
- Virtual host name or nullwebapps
- Directory file name or URL to look for auto
webapplication.defaults
- The defaults xml filename or URL which is
loaded before any in the web app. Must respect the web.dtd.
If null the default defaults file is used. If the empty string, then
no defaults file is used.extract
- If true, extract war filesjava2CompliantClassLoader
- True if java2 compliance is applied to all webapplications
java.io.IOException
public void setWebApplicationConfigurationClassNames(java.lang.String[] configurationClassNames)
configurationClasses
- public java.lang.String[] getWebApplicationConfigurationClassNames()
public static void main(java.lang.String[] arg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |