net.java.dev.moskito.core.dynamic
Class EntryCountLimitedOnDemandStatsProducer

java.lang.Object
  extended by net.java.dev.moskito.core.dynamic.OnDemandStatsProducer
      extended by net.java.dev.moskito.core.dynamic.EntryCountLimitedOnDemandStatsProducer
All Implemented Interfaces:
Inspectable, IStatsProducer

public class EntryCountLimitedOnDemandStatsProducer
extends OnDemandStatsProducer


Field Summary
private  int limit
           
 
Constructor Summary
EntryCountLimitedOnDemandStatsProducer(String aProducerId, String aCategory, String aSubsystem, IOnDemandStatsFactory aStatsFactory, int aLimit)
           
 
Method Summary
 int getLimit()
           
protected  String getProducerNameExtension()
           
protected  boolean limitForNewEntriesReached()
          The getStats method checked whether the limit is reached before creating a new stat object.
 void setLimit(int limit)
           
 String toString()
           
 
Methods inherited from class net.java.dev.moskito.core.dynamic.OnDemandStatsProducer
getCachedStatsList, getCategory, getCreationInfo, getDefaultStats, getProducerId, getStats, getStats, getSubsystem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

limit

private int limit
Constructor Detail

EntryCountLimitedOnDemandStatsProducer

public EntryCountLimitedOnDemandStatsProducer(String aProducerId,
                                              String aCategory,
                                              String aSubsystem,
                                              IOnDemandStatsFactory aStatsFactory,
                                              int aLimit)
Method Detail

getLimit

public int getLimit()

setLimit

public void setLimit(int limit)

getProducerNameExtension

protected String getProducerNameExtension()
Overrides:
getProducerNameExtension in class OnDemandStatsProducer

limitForNewEntriesReached

protected boolean limitForNewEntriesReached()
Description copied from class: OnDemandStatsProducer
The getStats method checked whether the limit is reached before creating a new stat object. Overwrite this function and return true if you want to limit the number of possible stored stats. Not limiting the stats can result in memory leak if someone can influence the stat names from the outside. Therefore MoskitoFilters are using EntryCountLimitedOnDemandStatsProducer instead.

Overrides:
limitForNewEntriesReached in class OnDemandStatsProducer
Returns:
false

toString

public String toString()
Overrides:
toString in class OnDemandStatsProducer


Copyright © 2006 MoSKito Project Team. All Rights Reserved.
MoSKito, the open source java monitoring framework