|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.source.CachedMonitorSource<L,M,K>
L - Location/invocation contextM - Simon typeK - Location keypublic abstract class CachedMonitorSource<L,M extends Simon,K>
Monitor source playing the role of cache for delegate monitor source.
| Nested Class Summary | |
|---|---|
private static class |
CachedMonitorSource.MonitorInformation
Monitor/location information. |
| Field Summary | |
|---|---|
private MonitorSource<L,M> |
delegate
Real monitor source. |
private Map<K,CachedMonitorSource.MonitorInformation> |
monitorInformations
Map location key → monitor information. |
private static CachedMonitorSource.MonitorInformation |
NULL_MONITOR_INFORMATION
Not monitored monitor information. |
| Constructor Summary | |
|---|---|
CachedMonitorSource(MonitorSource<L,M> delegate)
Constructor with real MonitorSource. |
|
| Method Summary | |
|---|---|
protected abstract K |
getLocationKey(L location)
Get location for given location. |
Manager |
getManager()
Returns the Manager used as a real source of monitors. |
M |
getMonitor(L location)
Get Simon for the specified location. |
private CachedMonitorSource.MonitorInformation |
getMonitorInformation(L location)
Get monitor information for given location. |
private M |
getMonitorOnce(L location)
|
boolean |
isMonitored(L location)
Check whether location should be monitored. |
private void |
removeMonitorInformation(L location)
Remove monitor information for given location. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final MonitorSource<L,M extends Simon> delegate
private static final CachedMonitorSource.MonitorInformation NULL_MONITOR_INFORMATION
private final Map<K,CachedMonitorSource.MonitorInformation> monitorInformations
| Constructor Detail |
|---|
public CachedMonitorSource(MonitorSource<L,M> delegate)
MonitorSource.
delegate - Delegate provider monitors for real| Method Detail |
|---|
protected abstract K getLocationKey(L location)
private CachedMonitorSource.MonitorInformation getMonitorInformation(L location)
location - Location
private void removeMonitorInformation(L location)
public boolean isMonitored(L location)
isMonitored in interface MonitorSource<L,M extends Simon>location - Location
private M getMonitorOnce(L location)
public M getMonitor(L location)
getMonitor in interface MonitorSource<L,M extends Simon>location - Location
public Manager getManager()
MonitorSourceManager used as a real source of monitors.
getManager in interface MonitorSource<L,M extends Simon>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||