Class ServletContainerFactory
- java.lang.Object
-
- org.rootservices.otter.server.container.ServletContainerFactory
-
public class ServletContainerFactory extends java.lang.ObjectCreated by tommackenzie on 4/3/16. A factory that creates a ServletContainer. System.setProperty("org.eclipse.jetty.LEVEL","INFO");
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description ServletContainerFactory(CompiledClassPath compiledClassPath, WebAppPath webAppPath)
-
Method Summary
Modifier and Type Method Description protected org.eclipse.jetty.webapp.Configuration[]makeConfigurations()protected org.eclipse.jetty.util.resource.PathResourcemakeFileResource(java.net.URI classPath)protected org.eclipse.jetty.server.CustomRequestLogmakeRequestLog(java.lang.String logFile)protected java.lang.StringmakeResourceBase(java.net.URI webApp)protected org.eclipse.jetty.server.ServerConnectormakeServerConnector(org.eclipse.jetty.server.Server server, int port)ServletContainermakeServletContainer(java.lang.String documentRoot, java.lang.Class clazz, int port, java.lang.String requestLog, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages)ServletContainermakeServletContainer(java.lang.String documentRoot, java.net.URI webApp, java.net.URI compliedClassPath, int port, java.lang.String requestLog, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages)protected org.eclipse.jetty.webapp.WebAppContextmakeWebAppContext(java.lang.String documentRoot, java.lang.String resourceBase, org.eclipse.jetty.webapp.Configuration[] configurations, org.eclipse.jetty.util.resource.PathResource containerResources, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages)protected org.eclipse.jetty.webapp.WebAppContextmakeWebAppContextForWAR(java.lang.String documentRoot, org.eclipse.jetty.webapp.Configuration[] configurations, org.eclipse.jetty.util.resource.Resource war, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages)
-
-
-
Constructor Detail
-
ServletContainerFactory
public ServletContainerFactory(CompiledClassPath compiledClassPath, WebAppPath webAppPath)
-
-
Method Detail
-
makeServletContainer
public ServletContainer makeServletContainer(java.lang.String documentRoot, java.lang.Class clazz, int port, java.lang.String requestLog, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages) throws java.net.URISyntaxException, java.io.IOException
- Parameters:
documentRoot- root path for the servlet container to run. example, "/"clazz- a class in your project.port- the port the container should use. 0 will randomly assign a port.requestLog- path to the request logerrorPages- a list of ErrorPages- Returns:
- a configured instance of ServletContainer
- Throws:
java.net.URISyntaxException- if an issue occurred constructing a URIjava.io.IOException- if issues come up regarding webapp or containerResources
-
makeServletContainer
public ServletContainer makeServletContainer(java.lang.String documentRoot, java.net.URI webApp, java.net.URI compliedClassPath, int port, java.lang.String requestLog, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages) throws java.io.IOException
- Parameters:
documentRoot- root path for the servlet container to run. example, "/"webApp- absolute file path to the webapp directory in your project.compliedClassPath- absolute file path to, target/classes/ in your project.port- the port the container should use. 0 will randomly assign a port.requestLog- path to the request logerrorPages- a list of ErrorPages- Returns:
- a configured instance of ServletContainer
- Throws:
java.io.IOException- if issues come up regarding webapp or containerResources
-
makeWebAppContext
protected org.eclipse.jetty.webapp.WebAppContext makeWebAppContext(java.lang.String documentRoot, java.lang.String resourceBase, org.eclipse.jetty.webapp.Configuration[] configurations, org.eclipse.jetty.util.resource.PathResource containerResources, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages)
-
makeWebAppContextForWAR
protected org.eclipse.jetty.webapp.WebAppContext makeWebAppContextForWAR(java.lang.String documentRoot, org.eclipse.jetty.webapp.Configuration[] configurations, org.eclipse.jetty.util.resource.Resource war, java.util.List<org.apache.tomcat.util.descriptor.web.ErrorPage> errorPages)
-
makeResourceBase
protected java.lang.String makeResourceBase(java.net.URI webApp) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
makeFileResource
protected org.eclipse.jetty.util.resource.PathResource makeFileResource(java.net.URI classPath) throws java.io.IOException- Throws:
java.io.IOException
-
makeConfigurations
protected org.eclipse.jetty.webapp.Configuration[] makeConfigurations()
-
makeServerConnector
protected org.eclipse.jetty.server.ServerConnector makeServerConnector(org.eclipse.jetty.server.Server server, int port)
-
makeRequestLog
protected org.eclipse.jetty.server.CustomRequestLog makeRequestLog(java.lang.String logFile)
-
-