接口 EmbeddedServletContainer
- 所有已知实现类:
JettyEmbeddedServletContainer
,TomcatEmbeddedServletContainer
,UndertowEmbeddedServletContainer
public interface EmbeddedServletContainer
Simple interface that represents a fully configured embedded servlet container (for example Tomcat or Jetty). Allows the container to bestarted
andstopped
.Instances of this class are usually obtained via a
EmbeddedServletContainerFactory
.
方法详细资料
start
void start() throws EmbeddedServletContainerException
Starts the embedded servlet container. Calling this method on an already started container has no effect.- 抛出:
EmbeddedServletContainerException
- if the container cannot be started
stop
void stop() throws EmbeddedServletContainerException
Stops the embedded servlet container. Calling this method on an already stopped container has no effect.- 抛出:
EmbeddedServletContainerException
- if the container cannot be stopped
getPort
int getPort()
Return the port this server is listening on.- 返回:
- the port (or -1 if none)