|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.moskito.core.stats.impl.IntervalRegistry
public class IntervalRegistry
This class implements a registry singleton to hold and create Interval instances.
| Field Summary | |
|---|---|
private static IntervalRegistry |
instance
This is the instance of the singleton. |
private Map<Integer,Interval> |
intervalsById
This Map holds all Intervals by their ids. |
private Map<String,Interval> |
intervalsByName
This Map holds all Intervals by their names. |
private AtomicInteger |
nextId
This is a Thread-safe counter to generate VM-wide uniqe ids for new Interval instances. |
private List<IntervalRegistryListener> |
registryListeners
This List holds all registered IntervalRegistryListeners. |
private IUpdateTriggerService |
updateTriggerService
This is a time control serive for periodic call backs. |
| Constructor Summary | |
|---|---|
private |
IntervalRegistry()
The contructor. |
| Method Summary | |
|---|---|
private Interval |
createInterval(String aName,
int aLength)
This method creates a new Interval with the given name and length. |
static IntervalRegistry |
getInstance()
This is the Singleton instance accessor method. |
(package private) Interval |
getInterval(int aId)
This method retrieves an Interval with the given id. |
Interval |
getInterval(String aName)
This method retrieves an Interval with the given name. |
Interval |
getInterval(String aName,
int aLength)
This method retrieves an Interval with the given name. |
List<Interval> |
getIntervals()
This method returns a list containing all known Intervals. |
private int |
obtainNextUniqueId()
This method returns the next free id. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static IntervalRegistry instance
private Map<Integer,Interval> intervalsById
private Map<String,Interval> intervalsByName
private AtomicInteger nextId
private IUpdateTriggerService updateTriggerService
private List<IntervalRegistryListener> registryListeners
IntervalRegistryListener| Constructor Detail |
|---|
private IntervalRegistry()
| Method Detail |
|---|
public static IntervalRegistry getInstance()
Interval getInterval(int aId)
aId - the Interval id
UnknownIntervalException - if no Interval with the given id could be found
public Interval getInterval(String aName,
int aLength)
aName - the Interval nameaLength - the length of the new Interval in seconds.
public Interval getInterval(String aName)
aName - the Interval name
private Interval createInterval(String aName,
int aLength)
aName - the name of the new IntervalaLength - the length of the Interval in seconds
private int obtainNextUniqueId()
public List<Interval> getIntervals()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||