public class Server extends HttpServer
XmlConfiguration
,
ServletHttpContext
,
Serialized FormConstructor and Description |
---|
Server()
Constructor.
|
Server(Resource configuration)
Constructor.
|
Server(String configuration)
Constructor.
|
Server(URL configuration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
WebApplicationContext |
addWebApplication(String contextPathSpec,
String webApp)
Add Web Application.
|
WebApplicationContext |
addWebApplication(String virtualHost,
String contextPathSpec,
String webApp)
Add Web Application.
|
WebApplicationContext[] |
addWebApplications(String webapps)
Add Web Applications.
|
WebApplicationContext[] |
addWebApplications(String host,
String webapps)
Add Web Applications.
|
WebApplicationContext[] |
addWebApplications(String host,
String webapps,
boolean extract)
Add Web Applications.
|
WebApplicationContext[] |
addWebApplications(String host,
String webapps,
String defaults,
boolean extract)
Add Web Applications.
|
WebApplicationContext[] |
addWebApplications(String host,
String webapps,
String defaults,
boolean extract,
boolean java2CompliantClassLoader)
Add Web Applications.
|
void |
configure(String configuration)
Configure the server from an XML file.
|
String |
getConfiguration() |
String |
getRootWebApp()
Get the root webapp name.
|
boolean |
getStopAtShutdown() |
String[] |
getWebApplicationConfigurationClassNames() |
static void |
main(String[] arg) |
protected HttpContext |
newHttpContext()
Create a new ServletHttpContext.
|
protected WebApplicationContext |
newWebApplicationContext(String webApp)
Create a new WebApplicationContext.
|
void |
setRootWebApp(String rootWebApp)
Set the root webapp name.
|
void |
setStopAtShutdown(boolean stop) |
void |
setWebApplicationConfigurationClassNames(String[] configurationClassNames)
setWebApplicationConfigurationClasses
Set up the list of classnames of WebApplicationContext.Configuration
implementations that will be applied to configure every webapp.
|
addContext, addContext, addContext, addContext, addHostAlias, addListener, addListener, addListener, addRealm, destroy, doStart, doStop, findHandler, getConnections, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpen, getConnectionsOpenMax, getConnectionsOpenMin, getConnectionsRequestsAve, getConnectionsRequestsMax, getConnectionsRequestsMin, getContext, getContext, getContext, getContexts, getErrors, getHostMap, getHttpServerList, getHttpServers, getListeners, getRealm, getRequestLog, getRequests, getRequestsActive, getRequestsActiveMax, getRequestsActiveMin, getRequestsDurationAve, getRequestsDurationMax, getRequestsDurationMin, getRequestsDurationTotal, getRequestsPerGC, getResolveRemoteHost, getServerClasses, getStatsOn, getStatsOnMs, getStopGracefully, getSystemClasses, getTrace, join, removeContext, removeListener, removeRealm, save, service, setAnonymous, setContexts, setListeners, setRequestLog, setRequestsPerGC, setResolveRemoteHost, setServerClasses, setStatsOn, setStopGracefully, setSystemClasses, setTrace, statsReset, stop
addComponent, addEventListener, getComponents, isStarted, isStarting, isStopping, removeComponent, removeEventListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventListener, removeEventListener
public Server()
public Server(String configuration) throws IOException
configuration
- The filename or URL of the XML
configuration file.IOException
public Server(Resource configuration) throws IOException
configuration
- The filename or URL of the XML
configuration file.IOException
public Server(URL configuration) throws IOException
configuration
- The filename or URL of the XML
configuration file.IOException
public boolean getStopAtShutdown()
public void setStopAtShutdown(boolean stop)
public String getRootWebApp()
public void setRootWebApp(String rootWebApp)
rootWebApp
- The name of the root webapp (eg. "root" for root.war).public void configure(String configuration) throws IOException
configuration
- The filename or URL of the XML
configuration file.IOException
public String getConfiguration()
protected HttpContext newHttpContext()
newHttpContext
in class HttpServer
protected WebApplicationContext newWebApplicationContext(String webApp)
webApp
- The Web application directory or WAR file.public WebApplicationContext addWebApplication(String contextPathSpec, String webApp) throws IOException
contextPathSpec
- The context path spec. Which must be of
the form / or /path/*webApp
- The Web application directory or WAR file.IOException
public WebApplicationContext addWebApplication(String virtualHost, String contextPathSpec, String webApp) throws 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.IOException
public WebApplicationContext[] addWebApplications(String webapps) throws IOException
webapps
- Directory file name or URL to look for auto webapplication.IOException
public WebApplicationContext[] addWebApplications(String host, String webapps) throws IOException
host
- Virtual host name or nullwebapps
- Directory file name or URL to look for auto webapplication.IOException
public WebApplicationContext[] addWebApplications(String host, String webapps, boolean extract) throws IOException
host
- Virtual host name or nullwebapps
- Directory file name or URL to look for auto
webapplication.extract
- If true, extract war filesIOException
public WebApplicationContext[] addWebApplications(String host, String webapps, String defaults, boolean extract) throws 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 filesIOException
public WebApplicationContext[] addWebApplications(String host, String webapps, String defaults, boolean extract, boolean java2CompliantClassLoader) throws 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 webapplicationsIOException
public void setWebApplicationConfigurationClassNames(String[] configurationClassNames)
configurationClassNames
- public String[] getWebApplicationConfigurationClassNames()
public static void main(String[] arg)
Copyright © 2013. All rights reserved.