public class Server extends HttpServer
XmlConfiguration,
ServletHttpContext,
Serialized Form| Constructor 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, stopaddComponent, addEventListener, getComponents, isStarted, isStarting, isStopping, removeComponent, removeEventListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisStarted, start, stopaddEventListener, removeEventListenerpublic Server()
public Server(String configuration) throws IOException
configuration - The filename or URL of the XML
configuration file.IOExceptionpublic Server(Resource configuration) throws IOException
configuration - The filename or URL of the XML
configuration file.IOExceptionpublic Server(URL configuration) throws IOException
configuration - The filename or URL of the XML
configuration file.IOExceptionpublic 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.IOExceptionpublic String getConfiguration()
protected HttpContext newHttpContext()
newHttpContext in class HttpServerprotected 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.IOExceptionpublic 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.IOExceptionpublic WebApplicationContext[] addWebApplications(String webapps) throws IOException
webapps - Directory file name or URL to look for auto webapplication.IOExceptionpublic WebApplicationContext[] addWebApplications(String host, String webapps) throws IOException
host - Virtual host name or nullwebapps - Directory file name or URL to look for auto webapplication.IOExceptionpublic 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 filesIOExceptionpublic 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 filesIOExceptionpublic 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 webapplicationsIOExceptionpublic void setWebApplicationConfigurationClassNames(String[] configurationClassNames)
configurationClasses - public String[] getWebApplicationConfigurationClassNames()
public static void main(String[] arg)
Copyright © 2016. All Rights Reserved.