net.java.dev.moskito.core.registry
Class ProducerRegistryAPIImpl

java.lang.Object
  extended by net.java.dev.moskito.core.registry.ProducerRegistryAPIImpl
All Implemented Interfaces:
IProducerRegistryAPI, IProducerRegistryListener, IIntervalListener, IntervalRegistryListener

public class ProducerRegistryAPIImpl
extends Object
implements IProducerRegistryAPI, IProducerRegistryListener, IntervalRegistryListener, IIntervalListener


Field Summary
private  List<IntervalInfo> _cachedIntervalInfos
           
private  List<IStatsProducer> _cachedProducerList
           
private  Map<String,IStatsProducer> _cachedProducerMap
           
private  Object cacheLock
           
private  Object intervalLock
           
private  IntervalRegistry intervalRegistry
           
private static org.apache.log4j.Logger log
           
private  IProducerRegistry registry
           
 
Constructor Summary
ProducerRegistryAPIImpl()
           
 
Method Summary
private  void buildProducerCacheFromScratch()
           
private  void createIntervalList()
           
 List<IStatsProducer> getAllProducers()
           
 List<IStatsProducer> getAllProducersByCategory(String category)
           
 List<IStatsProducer> getAllProducersBySubsystem(String subsystem)
           
 List<String> getCategories()
           
 List<IntervalInfo> getPresentIntervals()
           
 IStatsProducer getProducer(String producerId)
           
 List<IStatsProducer> getProducers(IProducerFilter filter)
           
 List<String> getSubsystems()
           
 void intervalCreated(Interval aInterval)
          This method will be called after a new Interval was created.
 void intervalUpdated(Interval aCaller)
          This method will be called if the time of the given Interval was elapsed.
 void notifyProducerRegistered(IStatsProducer producer)
           
 void notifyProducerUnregistered(IStatsProducer producer)
           
private  void rebuildProducerCache(Collection<IStatsProducer> producers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log

_cachedProducerList

private List<IStatsProducer> _cachedProducerList

_cachedProducerMap

private Map<String,IStatsProducer> _cachedProducerMap

_cachedIntervalInfos

private List<IntervalInfo> _cachedIntervalInfos

registry

private IProducerRegistry registry

intervalRegistry

private IntervalRegistry intervalRegistry

cacheLock

private Object cacheLock

intervalLock

private Object intervalLock
Constructor Detail

ProducerRegistryAPIImpl

ProducerRegistryAPIImpl()
Method Detail

buildProducerCacheFromScratch

private void buildProducerCacheFromScratch()

rebuildProducerCache

private void rebuildProducerCache(Collection<IStatsProducer> producers)

getAllProducers

public List<IStatsProducer> getAllProducers()
Specified by:
getAllProducers in interface IProducerRegistryAPI

getAllProducersByCategory

public List<IStatsProducer> getAllProducersByCategory(String category)
Specified by:
getAllProducersByCategory in interface IProducerRegistryAPI

getAllProducersBySubsystem

public List<IStatsProducer> getAllProducersBySubsystem(String subsystem)
Specified by:
getAllProducersBySubsystem in interface IProducerRegistryAPI

getPresentIntervals

public List<IntervalInfo> getPresentIntervals()
Specified by:
getPresentIntervals in interface IProducerRegistryAPI

createIntervalList

private void createIntervalList()

intervalUpdated

public void intervalUpdated(Interval aCaller)
Description copied from interface: IIntervalListener
This method will be called if the time of the given Interval was elapsed.

Specified by:
intervalUpdated in interface IIntervalListener
Parameters:
aCaller - The Interval that calls this method

intervalCreated

public void intervalCreated(Interval aInterval)
Description copied from interface: IntervalRegistryListener
This method will be called after a new Interval was created.

Specified by:
intervalCreated in interface IntervalRegistryListener
Parameters:
aInterval - the new Interval
See Also:
IntervalRegistryListener.intervalCreated(net.java.dev.moskito.core.stats.Interval)

getProducer

public IStatsProducer getProducer(String producerId)
Specified by:
getProducer in interface IProducerRegistryAPI

getProducers

public List<IStatsProducer> getProducers(IProducerFilter filter)
Specified by:
getProducers in interface IProducerRegistryAPI

notifyProducerRegistered

public void notifyProducerRegistered(IStatsProducer producer)
Specified by:
notifyProducerRegistered in interface IProducerRegistryListener

notifyProducerUnregistered

public void notifyProducerUnregistered(IStatsProducer producer)
Specified by:
notifyProducerUnregistered in interface IProducerRegistryListener

getCategories

public List<String> getCategories()
Specified by:
getCategories in interface IProducerRegistryAPI

getSubsystems

public List<String> getSubsystems()
Specified by:
getSubsystems in interface IProducerRegistryAPI


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