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(Tomcat tomcat)
Create a new
TomcatEmbeddedServletContainer instance. |
TomcatEmbeddedServletContainer(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.
|
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(Tomcat tomcat)
TomcatEmbeddedServletContainer
instance.tomcat
- the underlying Tomcat serverpublic TomcatEmbeddedServletContainer(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 Tomcat getTomcat()
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.