Class HttpHandlerChain
java.lang.Object
org.glassfish.grizzly.http.server.HttpHandler
org.glassfish.grizzly.http.server.HttpHandlerChain
- All Implemented Interfaces:
JmxEventListener
The HttpHandlerChain class allows the invocation of multiple
HttpHandlers
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[])- Author:
- Jeanfrancois Arcand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(HttpHandler httpHandler, String[] mappings) Add aHttpHandlerand its associated array of mapping.voidaddHandler(HttpHandler httpHandler, HttpHandlerRegistration[] mappings) Add aHttpHandlerand its associated array of mapping.voiddestroy()Invoked when theHttpServerand may be overridden by custom implementations to perform implementation specific resource reclaimation tasks.voidInvoked when JMX has been disabled.voidInvoked when JMX has been enabled.voidbooleanremoveHttpHandler(HttpHandler httpHandler) Remove aHttpHandlervoidMap theRequestto the properHttpHandlervoidstart()Called when theHttpHandler's container is started by invokingHttpServer.start().Methods inherited from class org.glassfish.grizzly.http.server.HttpHandler
getErrorPageGenerator, getName, getRequestExecutorProvider, getRequestURIEncoding, getSessionCookieName, getSessionManager, isAllowCustomStatusMessage, isAllowEncodedSlash, sendAcknowledgment, setAllowCustomStatusMessage, setAllowEncodedSlash, setDecodeUrl, setDispatcherHelper, setRequestURIEncoding, setRequestURIEncoding, updatePaths
-
Constructor Details
-
HttpHandlerChain
-
-
Method Details
-
jmxEnabled
public void jmxEnabled()Description copied from interface:JmxEventListenerInvoked when JMX has been enabled.- Specified by:
jmxEnabledin interfaceJmxEventListener- See Also:
-
jmxDisabled
public void jmxDisabled()Description copied from interface:JmxEventListenerInvoked when JMX has been disabled.- Specified by:
jmxDisabledin interfaceJmxEventListener- See Also:
-
service
Map theRequestto the properHttpHandler- Specified by:
servicein classHttpHandler- Parameters:
request- TheRequestresponse- TheResponse- Throws:
Exception
-
addHandler
Add aHttpHandlerand its associated array of mapping. The mapping data will be used to map incoming request to its associatedHttpHandler.- Parameters:
httpHandler-HttpHandlerinstancemappings- an array of mapping.
-
addHandler
Add aHttpHandlerand its associated array of mapping. The mapping data will be used to map incoming request to its associatedHttpHandler.- Parameters:
httpHandler-HttpHandlerinstancemappings- an array of mapping.
-
removeHttpHandler
Remove aHttpHandler- Parameters:
httpHandler-HttpHandlerto remove- Returns:
- true if removed
-
removeAllHttpHandlers
public void removeAllHttpHandlers() -
start
public void start()Description copied from class:HttpHandlerCalled when theHttpHandler's container is started by invokingHttpServer.start(). By default, it does nothing.- Overrides:
startin classHttpHandler
-
destroy
public void destroy()Description copied from class:HttpHandlerInvoked when theHttpServerand may be overridden by custom implementations to perform implementation specific resource reclaimation tasks. By default, this method does nothing.- Overrides:
destroyin classHttpHandler
-