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.
 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 getMaxConnections()
          Gets the maximum number of concurrent connections in keep-alive mode.
 int getSecondsTimeouts()
          Gets the number of seconds before a keep-alive connection that has been idle times out and is closed.
 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.
 void setMaxConnections(int maxConnections)
          Sets the maximum number of concurrent connections in keep-alive mode.
 void setSecondsTimeouts(int timeout)
          Sets the number of seconds before a keep-alive connection that has been idle times out and is closed.
 
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

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.


setMaxConnections

public void setMaxConnections(int maxConnections)
Sets the maximum number of concurrent connections in keep-alive mode.

Parameters:
maxConnections - Maximum number of concurrent connections in keep-alive mode.

getMaxConnections

public int getMaxConnections()
Gets the maximum number of concurrent connections in keep-alive mode.

Returns:
Maximum number of concurrent 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.


setSecondsTimeouts

public void setSecondsTimeouts(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

getSecondsTimeouts

public int getSecondsTimeouts()
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 © 2009 SUN Microsystems. All Rights Reserved.