org.logicalcobwebs.proxool.admin
Class StatsRoller

java.lang.Object
  extended by org.logicalcobwebs.proxool.admin.StatsRoller

 class StatsRoller
extends java.lang.Object

Responsbile for a single set of statistics. It rolls over to a new set whenever it should. It provides access to the latest complete set when it is available.

Since:
Proxool 0.7
Version:
$Revision: 1.8 $, $Date: 2003/10/27 20:24:48 $
Author:
bill, $Author: billhorsman $ (current maintainer)

Field Summary
private  java.lang.String alias
           
private  Statistics completeStatistics
           
private  CompositeStatisticsListener compositeStatisticsListener
           
private  Statistics currentStatistics
           
private static Log LOG
           
private  java.util.Calendar nextRollDate
           
private  int period
           
private  WriterPreferenceReadWriteLock readWriteLock
           
private  boolean running
           
private  int units
           
 
Constructor Summary
StatsRoller(java.lang.String alias, CompositeStatisticsListener compositeStatisticsListener, java.lang.String token)
           
 
Method Summary
protected  void cancel()
          Cancels the timer that outputs the stats
 void connectionRefused()
           
 void connectionReturned(long activeTime)
           
 Statistics getCompleteStatistics()
           
private  boolean isCurrent()
           
private  void roll()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

readWriteLock

private WriterPreferenceReadWriteLock readWriteLock

completeStatistics

private Statistics completeStatistics

currentStatistics

private Statistics currentStatistics

nextRollDate

private java.util.Calendar nextRollDate

period

private int period

units

private int units

running

private boolean running

compositeStatisticsListener

private CompositeStatisticsListener compositeStatisticsListener

alias

private java.lang.String alias
Constructor Detail

StatsRoller

public StatsRoller(java.lang.String alias,
                   CompositeStatisticsListener compositeStatisticsListener,
                   java.lang.String token)
            throws ProxoolException
Throws:
ProxoolException
Method Detail

cancel

protected void cancel()
Cancels the timer that outputs the stats


roll

private void roll()

isCurrent

private boolean isCurrent()

connectionReturned

public void connectionReturned(long activeTime)
See Also:
Admin.connectionReturned(long)

connectionRefused

public void connectionRefused()
See Also:
Admin.connectionRefused()

getCompleteStatistics

public Statistics getCompleteStatistics()
Returns: