org.logicalcobwebs.proxool.admin

Class Admin


public class Admin
extends java.lang.Object

Provides statistics about the performance of a pool.
Version:
$Revision: 1.9 $, $Date: 2006/01/18 14:39:57 $
Authors:
bill
$Author: billhorsman $ (current maintainer)
Since:
Proxool 0.7

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, Collection connectionInfos)
Get a new snapshot
StatisticsIF[]
getStatistics()
StatisticsIF
getStatistics(String token)
Returns the most recent sample that has completed its period

Constructor Details

Admin

public Admin(ConnectionPoolDefinitionIF definition)
            throws ProxoolException
Parameters:
definition - gives access to pool definition

Method Details

addStatisticsListener

public void addStatisticsListener(StatisticsListenerIF statisticsListener)

cancelAll

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

connectionRefused

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

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

getSnapshot

public static SnapshotIF getSnapshot(ConnectionPoolStatisticsIF cps,
                                     ConnectionPoolDefinitionIF cpd,
                                     Collection connectionInfos)
Get a new snapshot
Parameters:
cps - used to help populate the snapshot
cpd - used to help populate the snapshot
Returns:
snapshot

getStatistics

public StatisticsIF[] getStatistics()

getStatistics

public StatisticsIF getStatistics(String token)
Returns the most recent sample that has completed its period
Returns:
sample (or null if no statistics are complete yet)