Package org.glassfish.grizzly.http
Class KeepAlive
- java.lang.Object
-
- org.glassfish.grizzly.http.KeepAlive
-
- All Implemented Interfaces:
org.glassfish.grizzly.monitoring.MonitoringAware<KeepAliveProbe>
public final class KeepAlive extends Object implements org.glassfish.grizzly.monitoring.MonitoringAware<KeepAliveProbe>
Web container configuration for keep-alive HTTP connections.- Author:
- Alexey Stashok
-
-
Field Summary
Fields Modifier and Type Field Description protected org.glassfish.grizzly.monitoring.DefaultMonitoringConfig<KeepAliveProbe>monitoringConfigKeep alive probes
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectcreateJmxManagementObject()intgetIdleTimeoutInSeconds()intgetMaxRequestsCount()org.glassfish.grizzly.monitoring.MonitoringConfig<KeepAliveProbe>getMonitoringConfig()protected static voidnotifyProbesConnectionAccepted(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection)Notify registeredKeepAliveProbes about the "keep-alive connection accepted" event.protected static voidnotifyProbesHit(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection, int requestNumber)Notify registeredKeepAliveProbes about the "keep-alive connection hit" event.protected static voidnotifyProbesRefused(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection)Notify registeredKeepAliveProbes about the "keep-alive connection refused" event.protected static voidnotifyProbesTimeout(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection)Notify registeredKeepAliveProbes about the "keep-alive connection timeout" event.voidsetIdleTimeoutInSeconds(int idleTimeoutInSeconds)Configures idle connection timeout behavior.voidsetMaxRequestsCount(int maxRequestsCount)Configures the max number of HTTP requests allowed to be processed on one keep-alive connection.
-
-
-
Field Detail
-
monitoringConfig
protected final org.glassfish.grizzly.monitoring.DefaultMonitoringConfig<KeepAliveProbe> monitoringConfig
Keep alive probes
-
-
Method Detail
-
getIdleTimeoutInSeconds
public int getIdleTimeoutInSeconds()
- Returns:
- the number in seconds a connection may be idle before being timed out.
-
setIdleTimeoutInSeconds
public void setIdleTimeoutInSeconds(int idleTimeoutInSeconds)
Configures idle connection timeout behavior.
- Parameters:
idleTimeoutInSeconds- the number in seconds a connection may be idle before being timed out. Values less than zero are considered as FOREVER.
-
getMaxRequestsCount
public int getMaxRequestsCount()
- Returns:
- the max number of HTTP requests allowed to be processed on one keep-alive connection.
-
setMaxRequestsCount
public void setMaxRequestsCount(int maxRequestsCount)
Configures the max number of HTTP requests allowed to be processed on one keep-alive connection.
- Parameters:
maxRequestsCount- the max number of HTTP requests allowed to be processed on one keep-alive connection. Values less than zero are considered as UNLIMITED.
-
getMonitoringConfig
public org.glassfish.grizzly.monitoring.MonitoringConfig<KeepAliveProbe> getMonitoringConfig()
- Specified by:
getMonitoringConfigin interfaceorg.glassfish.grizzly.monitoring.MonitoringAware<KeepAliveProbe>
-
createJmxManagementObject
protected Object createJmxManagementObject()
-
notifyProbesConnectionAccepted
protected static void notifyProbesConnectionAccepted(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection)
Notify registeredKeepAliveProbes about the "keep-alive connection accepted" event.- Parameters:
keepAlive- the KeepAlive event occurred on.connection-Connectionbeen accepted.
-
notifyProbesHit
protected static void notifyProbesHit(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection, int requestNumber)
Notify registeredKeepAliveProbes about the "keep-alive connection hit" event.- Parameters:
keepAlive- the KeepAlive event occurred on.connection-Connectionbeen hit.requestNumber- the request number being processed on the givenConnection.
-
notifyProbesRefused
protected static void notifyProbesRefused(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection)
Notify registeredKeepAliveProbes about the "keep-alive connection refused" event.- Parameters:
keepAlive- the KeepAlive event occurred on.connection-Connectionbeen refused.
-
notifyProbesTimeout
protected static void notifyProbesTimeout(KeepAlive keepAlive, org.glassfish.grizzly.Connection connection)
Notify registeredKeepAliveProbes about the "keep-alive connection timeout" event.- Parameters:
keepAlive- the KeepAlive event occurred on.connection-Connectionbeen timeout.
-
-