Package org.eclipse.jetty.http.spi
Class JettyHttpServer
- java.lang.Object
-
- com.sun.net.httpserver.HttpServer
-
- org.eclipse.jetty.http.spi.JettyHttpServer
-
public class JettyHttpServer extends com.sun.net.httpserver.HttpServerJetty implementation ofHttpServer.
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.InetSocketAddress_addrprivate java.util.Map<java.lang.String,Connector>_connectorsprivate java.util.Map<java.lang.String,JettyHttpContext>_contextsprivate HttpConfiguration_httpConfigurationprivate Server_serverprivate boolean_serverSharedprivate static LoggerLOG
-
Constructor Summary
Constructors Constructor Description JettyHttpServer(Server server, boolean shared)JettyHttpServer(Server server, boolean shared, HttpConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(java.net.InetSocketAddress addr, int backlog)private voidcheckIfContextIsFree(java.lang.String path)private voidcleanUpConnectors()private voidcleanUpContexts()com.sun.net.httpserver.HttpContextcreateContext(java.lang.String path)com.sun.net.httpserver.HttpContextcreateContext(java.lang.String path, com.sun.net.httpserver.HttpHandler httpHandler)private ContextHandlerCollectionfindContextHandlerCollection(Handler[] handlers)java.net.InetSocketAddressgetAddress()java.util.concurrent.ExecutorgetExecutor()HttpConfigurationgetHttpConfiguration()protected ServergetServer()protected ServerConnectornewServerConnector(java.net.InetSocketAddress addr, int backlog)voidremoveContext(com.sun.net.httpserver.HttpContext context)voidremoveContext(java.lang.String path)voidsetExecutor(java.util.concurrent.Executor executor)voidstart()voidstop(int delay)
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
_httpConfiguration
private final HttpConfiguration _httpConfiguration
-
_server
private final Server _server
-
_serverShared
private boolean _serverShared
-
_addr
private java.net.InetSocketAddress _addr
-
_contexts
private java.util.Map<java.lang.String,JettyHttpContext> _contexts
-
_connectors
private java.util.Map<java.lang.String,Connector> _connectors
-
-
Constructor Detail
-
JettyHttpServer
public JettyHttpServer(Server server, boolean shared)
-
JettyHttpServer
public JettyHttpServer(Server server, boolean shared, HttpConfiguration configuration)
-
-
Method Detail
-
getHttpConfiguration
public HttpConfiguration getHttpConfiguration()
-
bind
public void bind(java.net.InetSocketAddress addr, int backlog) throws java.io.IOException- Specified by:
bindin classcom.sun.net.httpserver.HttpServer- Throws:
java.io.IOException
-
getServer
protected Server getServer()
-
newServerConnector
protected ServerConnector newServerConnector(java.net.InetSocketAddress addr, int backlog)
-
getAddress
public java.net.InetSocketAddress getAddress()
- Specified by:
getAddressin classcom.sun.net.httpserver.HttpServer
-
start
public void start()
- Specified by:
startin classcom.sun.net.httpserver.HttpServer
-
setExecutor
public void setExecutor(java.util.concurrent.Executor executor)
- Specified by:
setExecutorin classcom.sun.net.httpserver.HttpServer
-
getExecutor
public java.util.concurrent.Executor getExecutor()
- Specified by:
getExecutorin classcom.sun.net.httpserver.HttpServer
-
stop
public void stop(int delay)
- Specified by:
stopin classcom.sun.net.httpserver.HttpServer
-
cleanUpContexts
private void cleanUpContexts()
-
cleanUpConnectors
private void cleanUpConnectors()
-
createContext
public com.sun.net.httpserver.HttpContext createContext(java.lang.String path, com.sun.net.httpserver.HttpHandler httpHandler)- Specified by:
createContextin classcom.sun.net.httpserver.HttpServer
-
findContextHandlerCollection
private ContextHandlerCollection findContextHandlerCollection(Handler[] handlers)
-
checkIfContextIsFree
private void checkIfContextIsFree(java.lang.String path)
-
createContext
public com.sun.net.httpserver.HttpContext createContext(java.lang.String path)
- Specified by:
createContextin classcom.sun.net.httpserver.HttpServer
-
removeContext
public void removeContext(java.lang.String path) throws java.lang.IllegalArgumentException- Specified by:
removeContextin classcom.sun.net.httpserver.HttpServer- Throws:
java.lang.IllegalArgumentException
-
removeContext
public void removeContext(com.sun.net.httpserver.HttpContext context)
- Specified by:
removeContextin classcom.sun.net.httpserver.HttpServer
-
-