public abstract class VmPollingBackend extends BaseBackend implements VmStatusListener
Backend
class for implementations that will take some
action for each monitored JVM process on a regular interval. Simply
extend this class, implement any missing methods, and register one or
more VmPollingAction
implementations during instantiation.VmStatusListener.Status
ORDER_CODE_GROUP, ORDER_CPU_GROUP, ORDER_DEFAULT_GROUP, ORDER_FIRST, ORDER_IO_GROUP, ORDER_LAST, ORDER_MEMORY_GROUP, ORDER_NETWORK_GROUP, ORDER_THREAD_GROUP, ORDER_USER_GROUP
Constructor and Description |
---|
VmPollingBackend(String name,
String description,
String vendor,
Version version,
ScheduledExecutorService executor,
VmStatusListenerRegistrar registrar) |
Modifier and Type | Method and Description |
---|---|
boolean |
activate()
Activate the
Backend . |
boolean |
deactivate()
Deactivate the
Backend . |
boolean |
isActive() |
protected void |
registerAction(VmPollingAction action)
Register an action to be performed at each polling interval.
|
protected void |
unregisterAction(VmPollingAction action)
Unregister an action so that it will no longer be performed at each
polling interval.
|
void |
vmStatusChanged(VmStatusListener.Status newStatus,
String vmId,
int pid) |
equals, getDescription, getName, getObserveNewJvm, getVendor, getVersion, hashCode, setObserveNewJvm, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getOrderValue
public VmPollingBackend(String name, String description, String vendor, Version version, ScheduledExecutorService executor, VmStatusListenerRegistrar registrar)
protected final void registerAction(VmPollingAction action)
protected final void unregisterAction(VmPollingAction action)
public void vmStatusChanged(VmStatusListener.Status newStatus, String vmId, int pid)
vmStatusChanged
in interface VmStatusListener
public final boolean activate()
Backend
Backend
. Based on the current configuration,
begin pushing data to the Storage
layer.
If the Backend
is already active, this method should have no
effect.
Backend
is
registered.true
if the backend was activated successfully or
already active. false
if there was an errorpublic final boolean deactivate()
Backend
Backend
. The backend should release any
resources that were obtained as a direct result of a call to
Backend.activate()
. If the Backend
is not active, this
method should have no effect
Backend
is
deregistered.true
if the backend was successfully deactivated or
already inactive. false
if the backend is still active.public final boolean isActive()
Copyright © 2017. All rights reserved.