public class TomcatEmbeddedServletContainer extends Object implements EmbeddedServletContainer
EmbeddedServletContainer
that can be used to control an embedded Tomcat server.
Usually this class should be created using the
TomcatEmbeddedServletContainerFactory
and not directly.TomcatEmbeddedServletContainerFactory
Constructor and Description |
---|
TomcatEmbeddedServletContainer(org.apache.catalina.startup.Tomcat tomcat)
Create a new
TomcatEmbeddedServletContainer instance. |
TomcatEmbeddedServletContainer(org.apache.catalina.startup.Tomcat tomcat,
boolean autoStart)
Create a new
TomcatEmbeddedServletContainer instance. |
Modifier and Type | Method and Description |
---|---|
int |
getPort()
Return the port this server is listening on.
|
org.apache.catalina.startup.Tomcat |
getTomcat()
Returns access to the underlying Tomcat server.
|
void |
start()
Starts the embedded servlet container.
|
void |
stop()
Stops the embedded servlet container.
|
public TomcatEmbeddedServletContainer(org.apache.catalina.startup.Tomcat tomcat)
TomcatEmbeddedServletContainer
instance.tomcat
- the underlying Tomcat serverpublic TomcatEmbeddedServletContainer(org.apache.catalina.startup.Tomcat tomcat, boolean autoStart)
TomcatEmbeddedServletContainer
instance.tomcat
- the underlying Tomcat serverautoStart
- if the server should be startedpublic void start() throws EmbeddedServletContainerException
EmbeddedServletContainer
start
in interface EmbeddedServletContainer
EmbeddedServletContainerException
- if the container cannot be startedpublic void stop() throws EmbeddedServletContainerException
EmbeddedServletContainer
stop
in interface EmbeddedServletContainer
EmbeddedServletContainerException
- if the container cannot be stoppedpublic int getPort()
EmbeddedServletContainer
getPort
in interface EmbeddedServletContainer
public org.apache.catalina.startup.Tomcat getTomcat()
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.