public abstract class VmListenerBackend extends BaseBackend implements VmStatusListener
Backend
(via BaseBackend
) for those
that need to attach VmUpdateListener
in response to starting and stopping of JVMs on a
host.VmStatusListener
,
Backend
,
BaseBackend
VmStatusListener.Status
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 |
---|
VmListenerBackend(String backendName,
String description,
String vendor,
String version,
boolean observeNewJvm,
VmStatusListenerRegistrar registrar,
WriterID writerId) |
VmListenerBackend(String backendName,
String description,
String vendor,
String version,
VmStatusListenerRegistrar registrar,
WriterID writerId) |
Modifier and Type | Method and Description |
---|---|
boolean |
activate()
Activate the
Backend . |
protected abstract VmUpdateListener |
createVmListener(String writerId,
String vmId,
int pid)
Creates a new
VmUpdateListener for the virtual machine
specified by the pid. |
boolean |
deactivate()
Deactivate the
Backend . |
boolean |
isActive() |
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 VmListenerBackend(String backendName, String description, String vendor, String version, VmStatusListenerRegistrar registrar, WriterID writerId)
public boolean activate()
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.
Registers a VmUpdateListener to begin receiving VM lifecycle events.
Subclasses should call super.activate()
when overriding this method.
public boolean deactivate()
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.
Unregisters the VmUpdateListener to stop receiving VM lifecycle events.
Subclasses should call super.deactivate()
when overriding this method.
deactivate
in interface Backend
true
if the backend was successfully deactivated or
already inactive. false
if the backend is still active.public boolean isActive()
public void vmStatusChanged(VmStatusListener.Status newStatus, String vmId, int pid)
vmStatusChanged
in interface VmStatusListener
protected abstract VmUpdateListener createVmListener(String writerId, String vmId, int pid)
VmUpdateListener
for the virtual machine
specified by the pid. This method is called when a new
JVM is started or for JVMs already active when this Backend
was activated.vmId
- unique identifier of the JVMpid
- the process ID of the JVMCopyright © 2016. All rights reserved.