public class CorePlugin extends AbstractMonitorPlugin
| Modifier and Type | Class and Description |
|---|---|
private class |
CorePlugin.SyncObserver |
| Modifier and Type | Field and Description |
|---|---|
private Monitors<Counter> |
countersTimers |
private Monitors<HistorizableList> |
historizableLists |
private InApplicationMonitorJMXConnector |
inApplicationMonitorJMXConnector |
private KeyHandler |
keyHandler |
private static org.apache.log4j.Logger |
LOGGER |
private int |
maxHistoryEntriesToKeep |
protected boolean |
monitorActive |
private Monitors<MultiValueProvider> |
multiValues |
private CopyOnWriteArrayList<ReportableObserver> |
reportableObservers |
private static Object |
semaphore |
private Monitors<StateValueProvider> |
stateValues |
(package private) WeakReference<ReportableObserver> |
syncObserverReference |
private String |
uniqueName |
private Monitors<Version> |
versions |
| Constructor and Description |
|---|
CorePlugin(JmxAppMon4JNamingStrategy jmxAppMon4JNamingStrategy,
KeyHandler keyHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHighRateTimerMeasurement(String name,
long timing)
Add a timer measurement for a rarely occuring event with given name.
|
void |
addHistorizable(String name,
Historizable historizable)
add a
Historizable instance to the list identified by historizable.getName() |
void |
addReportableObserver(ReportableObserver reportableObserver)
adds a new ReportableObserver that wants to be notified about new Reportables that are
registered on the InApplicationMonitor
|
void |
addSingleEventTimerMeasurement(String name,
long timing)
Add a timer measurement for a rarely occuring event with given name.
|
void |
addTimerMeasurement(String name,
long timing)
Add a timer measurement for the given name.
|
void |
afterRemovalNotification() |
void |
destroy() |
(package private) Counter |
getCounter(String name)
internally used method to retrieve or create and register a named
Counter. |
(package private) HistorizableList |
getHistorizableList(String name)
internally used method to retrieve or create and register a named HistorizableList.
|
int |
getMaxHistoryEntriesToKeep() |
(package private) MultiValueProvider |
getMultiValueProvider(String name) |
List<String> |
getRegisteredReportableObservers() |
(package private) StateValueProvider |
getStateValue(String name) |
(package private) Timer |
getTimer(String name)
internaly used method to retrieve or create and register a named
Timer. |
String |
getUniqueName() |
void |
incrementCounter(String name,
int increment)
Increase the specified counter by a variable amount.
|
void |
incrementHighRateCounter(String name,
int increment) |
private void |
incrementInternalCounter(int increment,
String name) |
void |
initDefaultStateValues() |
void |
initializeCounter(String name)
Initialization of a counter.
|
void |
initializeTimerMeasurement(String name)
Initialization of a TimerMeasurement
|
private boolean |
isJMXInitialized() |
private void |
notifyReportableObservers(Reportable reportable) |
void |
registerMultiValueProvider(MultiValueProvider multiValueProvider)
Add a multi value provider to this appmon4j instance.
|
void |
registerStateValue(StateValueProvider stateValueProvider)
Add a state value provider to this appmon4j instance.
|
void |
registerVersion(Version versionToAdd)
This method was intended to register module names with their
current version identifier.
|
void |
removeReportableObserver(ReportableObserver reportableObserver)
Allow disconnection of observers, mainly for testing
|
void |
reportInto(ReportVisitor reportVisitor)
Implements the
InApplicationMonitor side of the Visitor pattern. |
void |
setMaxHistoryEntriesToKeep(int aMaxHistoryEntriesToKeep)
Set the Number of entries to keep for each Historizable list.
|
void |
syncFrom(CorePlugin corePluginToSyncWith) |
equals, hashCode, registerprivate static org.apache.log4j.Logger LOGGER
protected volatile boolean monitorActive
private volatile int maxHistoryEntriesToKeep
private final CopyOnWriteArrayList<ReportableObserver> reportableObservers
private final Monitors<StateValueProvider> stateValues
private final Monitors<MultiValueProvider> multiValues
private final Monitors<HistorizableList> historizableLists
private volatile InApplicationMonitorJMXConnector inApplicationMonitorJMXConnector
private KeyHandler keyHandler
WeakReference<ReportableObserver> syncObserverReference
private static final Object semaphore
private final String uniqueName
public CorePlugin(JmxAppMon4JNamingStrategy jmxAppMon4JNamingStrategy, KeyHandler keyHandler)
public void initDefaultStateValues()
public void afterRemovalNotification()
public void destroy()
public String getUniqueName()
private boolean isJMXInitialized()
public int getMaxHistoryEntriesToKeep()
public void setMaxHistoryEntriesToKeep(int aMaxHistoryEntriesToKeep)
aMaxHistoryEntriesToKeep - Number of entries to keeppublic void addReportableObserver(ReportableObserver reportableObserver)
reportableObserver - the class that wants to be notifiedprivate void notifyReportableObservers(Reportable reportable)
public void removeReportableObserver(ReportableObserver reportableObserver)
reportableObserver - public void reportInto(ReportVisitor reportVisitor)
InApplicationMonitor side of the Visitor pattern.
Iterates through all registered Reportable instances and calls
the corresponding method on the ReportVisitor implementation.reportVisitor - The ReportVisitor instance that shall be visited
by all regieteres Reportable instances.public void incrementCounter(String name, int increment)
Increase the specified counter by a variable amount.
name - the name of the Counter to increaseincrement - the added to addpublic void incrementHighRateCounter(String name, int increment)
private void incrementInternalCounter(int increment,
String name)
public void initializeCounter(String name)
name - the name of the counter to be initializedpublic void addTimerMeasurement(String name, long timing)
Timers allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested and some ReportVisitor implementations
may imply this.name - name of the Timertiming - number of elapsed time units for a single measurementpublic void addSingleEventTimerMeasurement(String name, long timing)
Timers allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested and some ReportVisitor implementations
may imply this.name - name of the Timertiming - number of elapsed time units for a single measurementpublic void addHighRateTimerMeasurement(String name, long timing)
Timers allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested and some ReportVisitor implementations
may imply this.name - name of the Timertiming - number of elapsed time units for a single measurementpublic void initializeTimerMeasurement(String name)
name - the name of the timer to be initializedpublic void registerStateValue(StateValueProvider stateValueProvider)
StateValueProvider instances allow access to a numeric
value (long), that is already available in the application.stateValueProvider - the StateValueProvider instance to addpublic void registerMultiValueProvider(MultiValueProvider multiValueProvider)
MultiValueProvider instances allow access to multiple numeric
values (long)multiValueProvider - the MultoValueProvider instance to addpublic void registerVersion(Version versionToAdd)
versionToAdd - The Version Object to addpublic void addHistorizable(String name, Historizable historizable)
Historizable instance to the list identified by historizable.getName()historizable - the historizable to addStateValueProvider getStateValue(String name)
name - the name of the StatsValueProviderMultiValueProvider getMultiValueProvider(String name)
name - the name of the MultiValueProviderCounter getCounter(String name)
Counter.Timer getTimer(String name)
Timer.HistorizableList getHistorizableList(String name)
name - of the required HistorizableListHistorizableList instance registered for the given namepublic void syncFrom(CorePlugin corePluginToSyncWith)
Copyright © 2013 Immobilien Scout GmbH. All Rights Reserved.