org.glassfish.grizzly.http
Class KeepAlive

java.lang.Object
  extended by org.glassfish.grizzly.http.KeepAlive
All Implemented Interfaces:
JmxMonitoringAware<KeepAliveProbe>, MonitoringAware<KeepAliveProbe>

public final class KeepAlive
extends Object
implements JmxMonitoringAware<KeepAliveProbe>

Web container configuration for keep-alive HTTP connections.

Author:
Alexey Stashok

Field Summary
protected  AbstractJmxMonitoringConfig<KeepAliveProbe> monitoringConfig
          Keep alive probes
 
Constructor Summary
KeepAlive()
           
 
Method Summary
protected  JmxObject createJmxManagementObject()
           
 int getIdleTimeoutInSeconds()
           
 int getMaxRequestsCount()
           
 JmxMonitoringConfig<KeepAliveProbe> getMonitoringConfig()
          
protected static void notifyProbesConnectionAccepted(KeepAlive keepAlive, Connection connection)
          Notify registered KeepAliveProbes about the "keep-alive connection accepted" event.
protected static void notifyProbesHit(KeepAlive keepAlive, Connection connection, int requestNumber)
          Notify registered KeepAliveProbes about the "keep-alive connection hit" event.
protected static void notifyProbesRefused(KeepAlive keepAlive, Connection connection)
          Notify registered KeepAliveProbes about the "keep-alive connection refused" event.
protected static void notifyProbesTimeout(KeepAlive keepAlive, Connection connection)
          Notify registered KeepAliveProbes 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

monitoringConfig

protected final AbstractJmxMonitoringConfig<KeepAliveProbe> monitoringConfig
Keep alive probes

Constructor Detail

KeepAlive

public KeepAlive()
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 JmxMonitoringConfig<KeepAliveProbe> getMonitoringConfig()

Specified by:
getMonitoringConfig in interface JmxMonitoringAware<KeepAliveProbe>
Specified by:
getMonitoringConfig in interface MonitoringAware<KeepAliveProbe>

createJmxManagementObject

protected JmxObject createJmxManagementObject()

notifyProbesConnectionAccepted

protected static void notifyProbesConnectionAccepted(KeepAlive keepAlive,
                                                     Connection connection)
Notify registered KeepAliveProbes 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 registered KeepAliveProbes 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 given Connection.

notifyProbesRefused

protected static void notifyProbesRefused(KeepAlive keepAlive,
                                          Connection connection)
Notify registered KeepAliveProbes about the "keep-alive connection refused" event.

Parameters:
keepAlive - the KeepAlive event occurred on.
connection - Connection been refused.

notifyProbesTimeout

protected static void notifyProbesTimeout(KeepAlive keepAlive,
                                          Connection connection)
Notify registered KeepAliveProbes about the "keep-alive connection timeout" event.

Parameters:
keepAlive - the KeepAlive event occurred on.
connection - Connection been timeout.


Copyright © 2010 Oracle Corpration. All Rights Reserved.