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
Modifier and TypeFieldDescriptionprotected final DefaultMonitoringConfig<KeepAliveProbe>
Keep alive probes -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
int
int
Return the object associatedMonitoringConfig
.protected static void
notifyProbesConnectionAccepted
(KeepAlive keepAlive, Connection connection) Notify registeredKeepAliveProbe
s about the "keep-alive connection accepted" event.protected static void
notifyProbesHit
(KeepAlive keepAlive, Connection connection, int requestNumber) Notify registeredKeepAliveProbe
s about the "keep-alive connection hit" event.protected static void
notifyProbesRefused
(KeepAlive keepAlive, Connection connection) Notify registeredKeepAliveProbe
s about the "keep-alive connection refused" event.protected static void
notifyProbesTimeout
(KeepAlive keepAlive, Connection connection) Notify registeredKeepAliveProbe
s about the "keep-alive connection timeout" event.void
setIdleTimeoutInSeconds
(int idleTimeoutInSeconds) Configures idle connection timeout behavior.void
setMaxRequestsCount
(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
- theKeepAlive
to 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:
getMonitoringConfig
in interfaceMonitoringAware<KeepAliveProbe>
- Returns:
- the object associated
MonitoringConfig
.
-
createJmxManagementObject
-
notifyProbesConnectionAccepted
Notify registeredKeepAliveProbe
s about the "keep-alive connection accepted" event.- Parameters:
keepAlive
- the KeepAlive event occurred on.connection
-Connection
been accepted.
-
notifyProbesHit
protected static void notifyProbesHit(KeepAlive keepAlive, Connection connection, int requestNumber) Notify registeredKeepAliveProbe
s about the "keep-alive connection hit" event.- Parameters:
keepAlive
- the KeepAlive event occurred on.connection
-Connection
been hit.requestNumber
- the request number being processed on the givenConnection
.
-
notifyProbesRefused
Notify registeredKeepAliveProbe
s about the "keep-alive connection refused" event.- Parameters:
keepAlive
- the KeepAlive event occurred on.connection
-Connection
been refused.
-
notifyProbesTimeout
Notify registeredKeepAliveProbe
s about the "keep-alive connection timeout" event.- Parameters:
keepAlive
- the KeepAlive event occurred on.connection
-Connection
been timeout.
-