Schnittstelle ServletContainerAdapter
- Alle bekannten Implementierungsklassen:
- HttpServiceServletContainerAdapter,- JettyServletContainer
public interface ServletContainerAdapter
Implement this to provide your own servlet container (instance),
 
 It's OK if you don't start or stop your container when this adapter is
 called. You can treat the startIfNotRunning() and
 stopIfRunning() methods as suggestions, they only indicate what
 the UPnP stack wants to do. If your servlet container handles other
 services, keep it running all the time.
 
An implementation must be thread-safe, all methods might be called concurrently by several threads.
- Autor:
- Christian Bauer
- 
MethodenübersichtModifizierer und TypMethodeBeschreibungintaddConnector(String host, int port) Might be called several times to set up the connectors.voidregisterServlet(String contextPath, javax.servlet.Servlet servlet) Might be called several times to register (the same) handler for UPnP requests, should only register it once.voidsetExecutorService(ExecutorService executorService) Might be called several times to integrate the servlet container with jUPnP's executor configuration.voidStart your servlet container if it isn't already running, might be called multiple times.voidStop your servlet container if it's still running, might be called multiple times.
- 
Methodendetails- 
setExecutorServiceMight be called several times to integrate the servlet container with jUPnP's executor configuration. You can ignore this call if you want to configure the container's thread pooling independently from jUPnP. If you use the given jUPnPExecutorService, make sure the Jetty container won't shut it down whenstopIfRunning()is called!- Parameter:
- executorService- The service to use when spawning new servlet execution threads.
 
- 
addConnectorMight be called several times to set up the connectors. This is the host/address and the port jUPnP expects to receive HTTP requests on. If you set up your HTTP server connectors elsewhere and ignore when jUPnP calls this method, make sure you configure jUPnP with the correct host/port of your servlet container.- Parameter:
- host- The host address for the socket.
- port- The port, might be- -1to bind to an ephemeral port.
- Gibt zurück:
- The actual registered local port.
- Löst aus:
- IOException- If the connector couldn't be opened to retrieve the registered local port.
 
- 
registerServletMight be called several times to register (the same) handler for UPnP requests, should only register it once.- Parameter:
- contextPath- The context path prefix for all UPnP requests.
- servlet- The servlet handling all UPnP requests.
 
- 
startIfNotRunningvoid startIfNotRunning()Start your servlet container if it isn't already running, might be called multiple times.
- 
stopIfRunningvoid stopIfRunning()Stop your servlet container if it's still running, might be called multiple times.
 
-