public class HttpsServerImpl extends HttpsServer
| Modifier and Type | Method and Description |
|---|---|
void |
bind(InetSocketAddress addr,
int backlog)
Binds a currently unbound HttpServer to the given address and port number.
|
org.jboss.sun.net.httpserver.HttpContextImpl |
createContext(String path)
Creates a HttpContext without initially specifying a handler.
|
org.jboss.sun.net.httpserver.HttpContextImpl |
createContext(String path,
HttpHandler handler)
Creates a HttpContext.
|
InetSocketAddress |
getAddress()
returns the address this server is listening on
|
Executor |
getExecutor()
returns this server's Executor object if one was specified with
HttpServer.setExecutor(Executor), or null if none was
specified. |
HttpsConfigurator |
getHttpsConfigurator()
Gets this server's
HttpsConfigurator object, if it has been set. |
void |
removeContext(HttpContext context)
Removes the given context from the server.
|
void |
removeContext(String path)
Removes the context identified by the given path from the server.
|
void |
setExecutor(Executor executor)
sets this server's
Executor object. |
void |
setHttpsConfigurator(HttpsConfigurator config)
Sets this server's
HttpsConfigurator object. |
void |
start()
Starts this server in a new background thread.
|
void |
stop(int delay)
stops this server by closing the listening socket and disallowing
any new exchanges from being processed.
|
create, create, createpublic void setHttpsConfigurator(HttpsConfigurator config)
HttpsServerHttpsConfigurator object.setHttpsConfigurator in class HttpsServerconfig - the HttpsConfigurator to setpublic HttpsConfigurator getHttpsConfigurator()
HttpsServerHttpsConfigurator object, if it has been set.getHttpsConfigurator in class HttpsServernull if not set.public void bind(InetSocketAddress addr, int backlog) throws IOException
HttpServerbind in class HttpServeraddr - the address to listen onbacklog - the socket backlog. If this value is less than or equal to zero,
then a system default value is used.BindException - if the server cannot bind to the requested address or if the server
is already bound.IOExceptionpublic void start()
HttpServerstart in class HttpServerpublic void setExecutor(Executor executor)
HttpServerExecutor object. An
Executor must be established before HttpServer.start() is called.
All HTTP requests are handled in tasks given to the executor.
If this method is not called (before start()) or if it is
called with a null Executor, then
a default implementation is used, which uses the thread
which was created by the HttpServer.start() method.setExecutor in class HttpServerexecutor - the Executor to set, or null for default
implementationpublic Executor getExecutor()
HttpServerHttpServer.setExecutor(Executor), or null if none was
specified.getExecutor in class HttpServernull if not set.public void stop(int delay)
HttpServerstop in class HttpServerdelay - the maximum time in seconds to wait until exchanges have finished.public org.jboss.sun.net.httpserver.HttpContextImpl createContext(String path, HttpHandler handler)
HttpServerHttpServer.removeContext(String) method.
The path specifies the root URI path for this context. The first character of path must be '/'.
The class overview describes how incoming request URIs are mapped to HttpContext instances.
createContext in class HttpServerpath - the root URI path to associate the context withhandler - the handler to invoke for incoming requests.public org.jboss.sun.net.httpserver.HttpContextImpl createContext(String path)
HttpServerHttpContext.setHandler(HttpHandler). A HttpContext represents a mapping from a
URI path to an exchange handler on this HttpServer. Once created, and when
the handler has been set, all requests
received by the server for the path will be handled by calling
the handler object. The context is identified by the path, and
can later be removed from the server using this with the HttpServer.removeContext(String) method.
The path specifies the root URI path for this context. The first character of path must be '/'.
The class overview describes how incoming request URIs are mapped to HttpContext instances.
createContext in class HttpServerpath - the root URI path to associate the context withpublic void removeContext(String path) throws IllegalArgumentException
HttpServerremoveContext in class HttpServerpath - the path of the handler to removeIllegalArgumentException - if no handler corresponding to this
path exists.public void removeContext(HttpContext context) throws IllegalArgumentException
HttpServerremoveContext in class HttpServercontext - the context to removeIllegalArgumentExceptionpublic InetSocketAddress getAddress()
HttpServergetAddress in class HttpServerCopyright © 2012 JBoss by Red Hat. All Rights Reserved.