Class HttpServerFilter
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.BaseFilter
-
- org.glassfish.grizzly.http.server.HttpServerFilter
-
- All Implemented Interfaces:
Filter,MonitoringAware<HttpServerProbe>
public class HttpServerFilter extends BaseFilter implements MonitoringAware<HttpServerProbe>
Filter implementation to provide high-level HTTP request/response processing.
-
-
Field Summary
Fields Modifier and Type Field Description protected DefaultMonitoringConfig<HttpServerProbe>monitoringConfigWeb server probes
-
Constructor Summary
Constructors Constructor Description HttpServerFilter(ServerFilterConfiguration config, DelayedExecutor delayedExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectcreateJmxManagementObject()voidexceptionOccurred(FilterChainContext ctx, java.lang.Throwable error)Override the default implementation to notify theReadHandler, if available, of any read error that has occurred during processing.ServerFilterConfigurationgetConfiguration()protected java.lang.StringgetFullServerName()HttpHandlergetHttpHandler()MonitoringConfig<HttpServerProbe>getMonitoringConfig()Return the object associatedMonitoringConfig.NextActionhandleEvent(FilterChainContext ctx, FilterChainEvent event)Handle custom event associated with theConnection.NextActionhandleRead(FilterChainContext ctx)Execute a unit of processing work to be performed, when channel will become available for reading.protected voidonTraceRequest(Request request, Response response)voidsetHttpHandler(HttpHandler httpHandler)-
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, handleAccept, handleClose, handleConnect, handleWrite, onAdded, onFilterChainChanged, onRemoved, toString
-
-
-
-
Field Detail
-
monitoringConfig
protected final DefaultMonitoringConfig<HttpServerProbe> monitoringConfig
Web server probes
-
-
Constructor Detail
-
HttpServerFilter
public HttpServerFilter(ServerFilterConfiguration config, DelayedExecutor delayedExecutor)
-
-
Method Detail
-
getHttpHandler
public HttpHandler getHttpHandler()
-
setHttpHandler
public void setHttpHandler(HttpHandler httpHandler)
-
getConfiguration
public ServerFilterConfiguration getConfiguration()
-
handleRead
public NextAction handleRead(FilterChainContext ctx) throws java.io.IOException
Description copied from class:BaseFilterExecute a unit of processing work to be performed, when channel will become available for reading. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleReadin interfaceFilter- Overrides:
handleReadin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
java.io.IOException
-
exceptionOccurred
public void exceptionOccurred(FilterChainContext ctx, java.lang.Throwable error)
Override the default implementation to notify theReadHandler, if available, of any read error that has occurred during processing.- Specified by:
exceptionOccurredin interfaceFilter- Overrides:
exceptionOccurredin classBaseFilter- Parameters:
ctx- event processingFilterChainContexterror- error, which occurred during FilterChain execution
-
handleEvent
public NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event) throws java.io.IOException
Description copied from class:BaseFilterHandle custom event associated with theConnection. ThisFiltermay either complete the required processing and returnStopAction, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returningInvokeAction.- Specified by:
handleEventin interfaceFilter- Overrides:
handleEventin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
java.io.IOException
-
getMonitoringConfig
public MonitoringConfig<HttpServerProbe> getMonitoringConfig()
Return the object associatedMonitoringConfig.- Specified by:
getMonitoringConfigin interfaceMonitoringAware<HttpServerProbe>- Returns:
- the object associated
MonitoringConfig.
-
createJmxManagementObject
protected java.lang.Object createJmxManagementObject()
-
onTraceRequest
protected void onTraceRequest(Request request, Response response) throws java.io.IOException
- Throws:
java.io.IOException
-
getFullServerName
protected java.lang.String getFullServerName()
-
-