Package org.glassfish.grizzly.http
Class KeepAlive
java.lang.Object
org.glassfish.grizzly.http.KeepAlive
- All Implemented Interfaces:
MonitoringAware<KeepAliveProbe>
Web container configuration for keep-alive HTTP connections.
- Author:
- Alexey Stashok
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DefaultMonitoringConfig<KeepAliveProbe>Keep alive probes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectintintReturn the object associatedMonitoringConfig.protected static voidnotifyProbesConnectionAccepted(KeepAlive keepAlive, Connection connection) Notify registeredKeepAliveProbes about the "keep-alive connection accepted" event.protected static voidnotifyProbesHit(KeepAlive keepAlive, Connection connection, int requestNumber) Notify registeredKeepAliveProbes about the "keep-alive connection hit" event.protected static voidnotifyProbesRefused(KeepAlive keepAlive, Connection connection) Notify registeredKeepAliveProbes about the "keep-alive connection refused" event.protected static voidnotifyProbesTimeout(KeepAlive keepAlive, 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 Details
-
monitoringConfig
Keep alive probes
-
-
Constructor Details
-
KeepAlive
public KeepAlive() -
KeepAlive
The copy constructor.- Parameters:
keepAlive- theKeepAliveto copy
-
-
Method Details
-
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
Return the object associatedMonitoringConfig.- Specified by:
getMonitoringConfigin interfaceMonitoringAware<KeepAliveProbe>- Returns:
- the object associated
MonitoringConfig.
-
createJmxManagementObject
-
notifyProbesConnectionAccepted
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, 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
Notify registeredKeepAliveProbes about the "keep-alive connection refused" event.- Parameters:
keepAlive- the KeepAlive event occurred on.connection-Connectionbeen refused.
-
notifyProbesTimeout
Notify registeredKeepAliveProbes about the "keep-alive connection timeout" event.- Parameters:
keepAlive- the KeepAlive event occurred on.connection-Connectionbeen timeout.
-