public class OnDemandStatsProducer<S extends IStats> extends java.lang.Object implements IStatsProducer<S>, Inspectable, TracingAwareProducer, AutoTieAbleProducer, LoggingAwareProducer
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CUMULATED_STATS_NAME
Constant for cumulated (aggregated) stats name.
|
| Constructor and Description |
|---|
OnDemandStatsProducer(java.lang.String aProducerId,
java.lang.String aCategory,
java.lang.String aSubsystem,
IOnDemandStatsFactory<S> aStatsFactory)
Creates a new OnDemandStatsProducer instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disableLogging()
Disables logging of all method calls.
|
void |
enableLogging()
Enables logging of all methods calls.
|
protected java.util.List<S> |
getCachedStatsList() |
java.lang.String |
getCategory()
Returns the category of this producer.
|
CreationInfo |
getCreationInfo()
Returns the creation info about a producer.
|
S |
getDefaultStats() |
java.lang.String |
getProducerId()
Returns the meaningful id of this producer.
|
protected java.lang.String |
getProducerNameExtension() |
java.util.List<S> |
getStats()
Returns the list of all stats.
|
S |
getStats(java.lang.String name) |
java.lang.String |
getSubsystem()
Returns the subsystem the current producer is located in.
|
boolean |
isLoggingEnabled()
Returns true if logging is currently enabled.
|
boolean |
isLoggingSupported()
Returns true if the logging is supported by this producer.
|
protected boolean |
limitForNewEntriesReached()
The getStats method checked whether the limit is reached before creating a new stat object.
|
void |
setLoggingSupported(boolean loggingSupported) |
void |
setTracingSupported(boolean tracingSupported) |
java.lang.String |
toString() |
boolean |
tracingSupported()
Returns true if tracing is supported by this producer.
|
public static final java.lang.String CUMULATED_STATS_NAME
public OnDemandStatsProducer(java.lang.String aProducerId,
java.lang.String aCategory,
java.lang.String aSubsystem,
IOnDemandStatsFactory<S> aStatsFactory)
aProducerId - a producer idaCategory - a categoryaSubsystem - a subsystemaStatsFactory - a factory for IStat object creation.public S getStats(java.lang.String name) throws OnDemandStatsProducerException
OnDemandStatsProducerExceptionpublic java.lang.String getCategory()
IStatsProducergetCategory in interface IStatsProducer<S extends IStats>public java.lang.String getProducerId()
IStatsProducergetProducerId in interface IStatsProducer<S extends IStats>public java.util.List<S> getStats()
IStatsProducergetStats in interface IStatsProducer<S extends IStats>public java.lang.String getSubsystem()
IStatsProducergetSubsystem in interface IStatsProducer<S extends IStats>public S getDefaultStats()
public java.lang.String toString()
toString in class java.lang.Objectprotected boolean limitForNewEntriesReached()
protected java.lang.String getProducerNameExtension()
protected java.util.List<S> getCachedStatsList()
public CreationInfo getCreationInfo()
getCreationInfo in interface Inspectablepublic void setTracingSupported(boolean tracingSupported)
public boolean tracingSupported()
TracingAwareProducertracingSupported in interface TracingAwareProducerpublic boolean isLoggingEnabled()
LoggingAwareProducerisLoggingEnabled in interface LoggingAwareProducerpublic boolean isLoggingSupported()
LoggingAwareProducerisLoggingSupported in interface LoggingAwareProducerpublic void enableLogging()
LoggingAwareProducerenableLogging in interface LoggingAwareProducerpublic void disableLogging()
LoggingAwareProducerdisableLogging in interface LoggingAwareProducerpublic void setLoggingSupported(boolean loggingSupported)
Copyright © 2010-2020 anotheria.net. All Rights Reserved.