com.sun.grizzly.http
Class KeepAliveStats

java.lang.Object
  extended by com.sun.grizzly.http.KeepAliveStats

public class KeepAliveStats
extends Object

Class collecting keep-alive statistics. There is one instance of this class per HTTP listener (ie., SelectorThread). Each instance exposes its stats as an MBean with an object name of the form ":type=KeepAlive,name=http", where is replaced with the port number of the associated HTTP listener.

Author:
Jan Luehe

Constructor Summary
KeepAliveStats()
           
 
Method Summary
protected  void decrementCountConnections()
          Decrement the number of connections in keep-alive mode.
 void disable()
           
 void enable()
           
 int getCountConnections()
          Gets the number of connections in keep-alive mode.
 int getCountFlushes()
          Gets the number of keep-alive connections that were closed
 int getCountHits()
          Gets the number of requests received by connections in keep-alive mode.
 int getCountRefusals()
          Gets the number of keep-alive connections that were rejected.
 int getCountTimeouts()
          Gets the number of keep-alive connections that timed out.
 int getKeepAliveTimeoutInSeconds()
          Gets the number of seconds before a keep-alive connection that has been idle times out and is closed.
 int getMaxKeepAliveRequests()
           
 void incrementCountConnections()
          Increments the number of connections in keep-alive mode.
 void incrementCountFlushes()
          Increments the number of keep-alive connections that were closed
 void incrementCountHits()
          Increments the number of requests received by connections in keep-alive mode.
 void incrementCountRefusals()
          Increments the number of keep-alive connections that were rejected.
 void incrementCountTimeouts()
          Increments the number of keep-alive connections that timed out.
 boolean isEnabled()
           
 void setKeepAliveTimeoutInSeconds(int timeout)
          Sets the number of seconds before a keep-alive connection that has been idle times out and is closed.
 void setMaxKeepAliveRequests(int maxKeepAliveRequests)
          Set the maximum number of Keep-Alive requests that we will honor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeepAliveStats

public KeepAliveStats()
Method Detail

enable

public void enable()

disable

public void disable()

isEnabled

public boolean isEnabled()

getCountConnections

public int getCountConnections()
Gets the number of connections in keep-alive mode.

Returns:
Number of connections in keep-alive mode

incrementCountConnections

public void incrementCountConnections()
Increments the number of connections in keep-alive mode.


decrementCountConnections

protected void decrementCountConnections()
Decrement the number of connections in keep-alive mode.


getCountHits

public int getCountHits()
Gets the number of requests received by connections in keep-alive mode.

Returns:
Number of requests received by connections in keep-alive mode.

incrementCountHits

public void incrementCountHits()
Increments the number of requests received by connections in keep-alive mode.


getCountFlushes

public int getCountFlushes()
Gets the number of keep-alive connections that were closed

Returns:
Number of keep-alive connections that were closed

incrementCountFlushes

public void incrementCountFlushes()
Increments the number of keep-alive connections that were closed


getCountRefusals

public int getCountRefusals()
Gets the number of keep-alive connections that were rejected.

Returns:
Number of keep-alive connections that were rejected.

incrementCountRefusals

public void incrementCountRefusals()
Increments the number of keep-alive connections that were rejected.


getCountTimeouts

public int getCountTimeouts()
Gets the number of keep-alive connections that timed out.

Returns:
Number of keep-alive connections that timed out.

incrementCountTimeouts

public void incrementCountTimeouts()
Increments the number of keep-alive connections that timed out.


getMaxKeepAliveRequests

public int getMaxKeepAliveRequests()

setMaxKeepAliveRequests

public void setMaxKeepAliveRequests(int maxKeepAliveRequests)
Set the maximum number of Keep-Alive requests that we will honor.


setKeepAliveTimeoutInSeconds

public void setKeepAliveTimeoutInSeconds(int timeout)
Sets the number of seconds before a keep-alive connection that has been idle times out and is closed.

Parameters:
timeout - Keep-alive timeout in number of seconds

getKeepAliveTimeoutInSeconds

public int getKeepAliveTimeoutInSeconds()
Gets the number of seconds before a keep-alive connection that has been idle times out and is closed.

Returns:
Keep-alive timeout in number of seconds


Copyright © 2012 Oracle Corporation. All Rights Reserved.