Top Description Fields Constructors Methods
org.glassfish.grizzly.http

public final Class KeepAlive

extends Object
implements MonitoringAware<KeepAliveProbe>
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.monitoring.MonitoringAware
Imports
org.glassfish.grizzly.Connection, org.glassfish.grizzly.http.util.Constants, org.glassfish.grizzly.monitoring.DefaultMonitoringConfig, .MonitoringAware, .MonitoringConfig, .MonitoringUtils

Web container configuration for keep-alive HTTP connections.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
private int
idleTimeoutInSeconds

The number int seconds a connection may be idle before being timed out.

private int
maxRequestsCount

The max number of HTTP requests allowed to be processed on one keep-alive connection.

protected final DefaultMonitoringConfig<KeepAliveProbe>
monitoringConfig

Keep alive probes

Constructor Summary

AccessConstructor and Description
public
public
KeepAlive(final KeepAlive
the KeepAlive to copy
keepAlive
)

The copy constructor.

Method Summary

Modifier and TypeMethod and Description
protected Object
public int
getIdleTimeoutInSeconds()

Returns: the number in seconds a connection may be idle before being timed out.

public int
getMaxRequestsCount()

Returns: the max number of HTTP requests allowed to be processed on one keep-alive connection.

public MonitoringConfig<KeepAliveProbe>
protected static void
notifyProbesConnectionAccepted(final KeepAlive
the KeepAlive event occurred on.
keepAlive
,
final Connection<L>
Connection been accepted.
connection
)

Notify registered KeepAliveProbes about the "keep-alive connection accepted" event.

protected static void
notifyProbesHit(final KeepAlive
the KeepAlive event occurred on.
keepAlive
,
final Connection<L>
Connection been hit.
connection
,
final int
the request number being processed on the given Connection.
requestNumber
)

Notify registered KeepAliveProbes about the "keep-alive connection hit" event.

protected static void
notifyProbesRefused(final KeepAlive
the KeepAlive event occurred on.
keepAlive
,
final Connection<L>
Connection been refused.
connection
)

Notify registered KeepAliveProbes about the "keep-alive connection refused" event.

protected static void
notifyProbesTimeout(final KeepAlive
the KeepAlive event occurred on.
keepAlive
,
final Connection<L>
Connection been timeout.
connection
)

Notify registered KeepAliveProbes about the "keep-alive connection timeout" event.

public void
setIdleTimeoutInSeconds(final int
the number in seconds a connection may be idle before being timed out. Values less than zero are considered as FOREVER.
idleTimeoutInSeconds
)

Configures idle connection timeout behavior.

public void
setMaxRequestsCount(int
the max number of HTTP requests allowed to be processed on one keep-alive connection. Values less than zero are considered as UNLIMITED.
maxRequestsCount
)

Configures the max number of HTTP requests allowed to be processed on one keep-alive connection.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idleTimeoutInSecondsback to summary
private int idleTimeoutInSeconds

The number int seconds a connection may be idle before being timed out.

maxRequestsCountback to summary
private int maxRequestsCount

The max number of HTTP requests allowed to be processed on one keep-alive connection.

monitoringConfigback to summary
protected final DefaultMonitoringConfig<KeepAliveProbe> monitoringConfig

Keep alive probes

Constructor Detail

KeepAliveback to summary
public KeepAlive()
KeepAliveback to summary
public KeepAlive(final KeepAlive keepAlive)

The copy constructor.

Parameters
keepAlive:KeepAlive

the KeepAlive to copy

Method Detail

createJmxManagementObjectback to summary
protected Object createJmxManagementObject()
getIdleTimeoutInSecondsback to summary
public int getIdleTimeoutInSeconds()
Returns:int

the number in seconds a connection may be idle before being timed out.

getMaxRequestsCountback to summary
public int getMaxRequestsCount()
Returns:int

the max number of HTTP requests allowed to be processed on one keep-alive connection.

getMonitoringConfigback to summary
public MonitoringConfig<KeepAliveProbe> getMonitoringConfig()

Implements org.glassfish.grizzly.monitoring.MonitoringAware.getMonitoringConfig.

Doc from org.glassfish.grizzly.monitoring.MonitoringAware.getMonitoringConfig.

Return the object associated MonitoringConfig.

Annotations
@Override
notifyProbesConnectionAcceptedback to summary
protected static void notifyProbesConnectionAccepted(final KeepAlive keepAlive, final Connection<L> connection)

Notify registered KeepAliveProbes about the "keep-alive connection accepted" event.

Parameters
keepAlive:KeepAlive

the KeepAlive event occurred on.

connection:Connection<L>

Connection been accepted.

notifyProbesHitback to summary
protected static void notifyProbesHit(final KeepAlive keepAlive, final Connection<L> connection, final int requestNumber)

Notify registered KeepAliveProbes about the "keep-alive connection hit" event.

Parameters
keepAlive:KeepAlive

the KeepAlive event occurred on.

connection:Connection<L>

Connection been hit.

requestNumber:int

the request number being processed on the given Connection.

notifyProbesRefusedback to summary
protected static void notifyProbesRefused(final KeepAlive keepAlive, final Connection<L> connection)

Notify registered KeepAliveProbes about the "keep-alive connection refused" event.

Parameters
keepAlive:KeepAlive

the KeepAlive event occurred on.

connection:Connection<L>

Connection been refused.

notifyProbesTimeoutback to summary
protected static void notifyProbesTimeout(final KeepAlive keepAlive, final Connection<L> connection)

Notify registered KeepAliveProbes about the "keep-alive connection timeout" event.

Parameters
keepAlive:KeepAlive

the KeepAlive event occurred on.

connection:Connection<L>

Connection been timeout.

setIdleTimeoutInSecondsback to summary
public void setIdleTimeoutInSeconds(final int idleTimeoutInSeconds)

Configures idle connection timeout behavior.

Parameters
idleTimeoutInSeconds:int

the number in seconds a connection may be idle before being timed out. Values less than zero are considered as FOREVER.

setMaxRequestsCountback to summary
public void setMaxRequestsCount(int maxRequestsCount)

Configures the max number of HTTP requests allowed to be processed on one keep-alive connection.

Parameters
maxRequestsCount:int

the max number of HTTP requests allowed to be processed on one keep-alive connection. Values less than zero are considered as UNLIMITED.