Package org.terracotta.statistics
Class AbstractSourceStatistic<T extends ChainedObserver>
- java.lang.Object
-
- org.terracotta.statistics.AbstractSourceStatistic<T>
-
- All Implemented Interfaces:
SourceStatistic<T>
- Direct Known Subclasses:
AbstractOperationStatistic,OperationResultFilter
public class AbstractSourceStatistic<T extends ChainedObserver> extends java.lang.Object implements SourceStatistic<T>
An abstractSourceStatisticthat handles derived statistic (de)registration.This implementation exposes the currently registered statistics via the
derivedStatisticscollection. Concrete implementations of this class should fire on the contents of this to update the derived statistics.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Collection<T>derivedStatistics
-
Constructor Summary
Constructors Constructor Description AbstractSourceStatistic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDerivedStatistic(T derived)Register the givenObserverto be called by thisSourceStatisticjava.util.Collection<T>getDerivedStatistics()Retrieve all registered statistics.voidremoveDerivedStatistic(T derived)Remove the given registeredObserverfrom thisSourceStatistic.
-
-
-
Field Detail
-
derivedStatistics
protected final java.util.Collection<T extends ChainedObserver> derivedStatistics
-
-
Method Detail
-
addDerivedStatistic
public void addDerivedStatistic(T derived)
Description copied from interface:SourceStatisticRegister the givenObserverto be called by thisSourceStatistic- Specified by:
addDerivedStatisticin interfaceSourceStatistic<T extends ChainedObserver>- Parameters:
derived- statistic to be registered
-
removeDerivedStatistic
public void removeDerivedStatistic(T derived)
Description copied from interface:SourceStatisticRemove the given registeredObserverfrom thisSourceStatistic.- Specified by:
removeDerivedStatisticin interfaceSourceStatistic<T extends ChainedObserver>- Parameters:
derived- statistic to be removed
-
getDerivedStatistics
public java.util.Collection<T> getDerivedStatistics()
Description copied from interface:SourceStatisticRetrieve all registered statistics.- Specified by:
getDerivedStatisticsin interfaceSourceStatistic<T extends ChainedObserver>- Returns:
- an unmodifiable collection of all derived statistics
-
-