public class HttpHandlerChain extends HttpHandler implements JmxEventListener
HttpHandler
s
every time a new HTTP request is ready to be handled. Requests are mapped
to their associated HttpHandler
at runtime using the mapping
information configured when invoking the (org.glassfish.grizzly.http.server.HttpHandler, java.lang.String[])
Constructor and Description |
---|
HttpHandlerChain(HttpServer httpServer) |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(HttpHandler httpHandler,
HttpHandlerRegistration[] mappings)
Add a
HttpHandler and its associated array of mapping. |
void |
addHandler(HttpHandler httpHandler,
String[] mappings)
Add a
HttpHandler and its associated array of mapping. |
void |
destroy()
Invoked when the
HttpServer and may be overridden by custom
implementations to perform implementation specific resource reclaimation
tasks. |
void |
jmxDisabled()
Invoked when JMX has been disabled.
|
void |
jmxEnabled()
Invoked when JMX has been enabled.
|
void |
removeAllHttpHandlers() |
boolean |
removeHttpHandler(HttpHandler httpHandler)
Remove a
HttpHandler |
void |
service(Request request,
Response response)
Map the
Request to the proper HttpHandler |
void |
start()
Called when the
HttpHandler 's
container is started by invoking HttpServer.start() . |
getErrorPageGenerator, getName, getRequestExecutorProvider, getRequestURIEncoding, getSessionCookieName, getSessionManager, isAllowCustomStatusMessage, isAllowEncodedSlash, sendAcknowledgment, setAllowCustomStatusMessage, setAllowEncodedSlash, setDecodeUrl, setDispatcherHelper, setRequestURIEncoding, setRequestURIEncoding, updatePaths
public HttpHandlerChain(HttpServer httpServer)
public void jmxEnabled()
JmxEventListener
jmxEnabled
in interface JmxEventListener
ServerConfiguration.setJmxEnabled(boolean)
public void jmxDisabled()
JmxEventListener
jmxDisabled
in interface JmxEventListener
ServerConfiguration.setJmxEnabled(boolean)
public void service(Request request, Response response) throws Exception
Request
to the proper HttpHandler
service
in class HttpHandler
request
- The Request
response
- The Response
Exception
public void addHandler(HttpHandler httpHandler, String[] mappings)
HttpHandler
and its associated array of mapping. The mapping
data will be used to map incoming request to its associated HttpHandler
.httpHandler
- HttpHandler
instancemappings
- an array of mapping.public void addHandler(HttpHandler httpHandler, HttpHandlerRegistration[] mappings)
HttpHandler
and its associated array of mapping. The mapping
data will be used to map incoming request to its associated HttpHandler
.httpHandler
- HttpHandler
instancemappings
- an array of mapping.public boolean removeHttpHandler(HttpHandler httpHandler)
HttpHandler
httpHandler
- HttpHandler
to removepublic void removeAllHttpHandlers()
public void start()
HttpHandler
HttpHandler
's
container is started by invoking HttpServer.start()
.
By default, it does nothing.start
in class HttpHandler
public void destroy()
HttpHandler
HttpServer
and may be overridden by custom
implementations to perform implementation specific resource reclaimation
tasks.
By default, this method does nothing.destroy
in class HttpHandler
Copyright © 2015 Oracle Corporation. All rights reserved.