org.logicalcobwebs.proxool.admin
Class Admin

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

public class Admin
extends java.lang.Object

Provides statistics about the performance of a pool.

Since:
Proxool 0.7
Version:
$Revision: 1.8 $, $Date: 2005/10/02 12:32:01 $
Author:
bill, $Author: billhorsman $ (current maintainer)

Field Summary
private  CompositeStatisticsListener compositeStatisticsListener
           
private  Log log
           
private static Log LOG
           
private  java.util.Map statsRollers
           
 
Constructor Summary
Admin(ConnectionPoolDefinitionIF definition)
           
 
Method Summary
 void addStatisticsListener(StatisticsListenerIF statisticsListener)
           
 void cancelAll()
          Cancels the timer that outputs the stats
 void connectionRefused()
          Call this every time a connection is refused
 void connectionReturned(long activeTime)
          Call this every time an active connection is returned to the pool
static SnapshotIF getSnapshot(ConnectionPoolStatisticsIF cps, ConnectionPoolDefinitionIF cpd, java.util.Collection connectionInfos)
          Get a new snapshot
 StatisticsIF[] getStatistics()
           
 StatisticsIF getStatistics(java.lang.String token)
          Returns the most recent sample that has completed its period
 
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

log

private Log log

statsRollers

private java.util.Map statsRollers

compositeStatisticsListener

private CompositeStatisticsListener compositeStatisticsListener
Constructor Detail

Admin

public Admin(ConnectionPoolDefinitionIF definition)
      throws ProxoolException
Parameters:
definition - gives access to pool definition
definition - see definition
Throws:
ProxoolException
Method Detail

addStatisticsListener

public void addStatisticsListener(StatisticsListenerIF statisticsListener)

connectionReturned

public void connectionReturned(long activeTime)
Call this every time an active connection is returned to the pool

Parameters:
activeTime - how long the connection was active

connectionRefused

public void connectionRefused()
Call this every time a connection is refused


getStatistics

public StatisticsIF getStatistics(java.lang.String token)
Returns the most recent sample that has completed its period

Returns:
sample (or null if no statistics are complete yet)

cancelAll

public void cancelAll()
Cancels the timer that outputs the stats


getStatistics

public StatisticsIF[] getStatistics()

getSnapshot

public static SnapshotIF getSnapshot(ConnectionPoolStatisticsIF cps,
                                     ConnectionPoolDefinitionIF cpd,
                                     java.util.Collection connectionInfos)
Get a new snapshot

Parameters:
cps - used to help populate the snapshot
cpd - used to help populate the snapshot
Returns:
snapshot