
public abstract class MonitoredHost extends Object
MonitoredVm instances. Concrete implementations of this class
provide methods for managing the communications protocols and provide
for event notification.HostIdentifier,
VmIdentifier,
MonitoredVm,
HostListener| Modifier and Type | Field and Description |
|---|---|
protected HostIdentifier |
hostId
The HostIdentifier for this MonitoredHost instance.
|
protected int |
interval
The polling interval, in milliseconds, for this MonitoredHost instance.
|
protected Exception |
lastException
The last Exception encountered while polling this MonitoredHost.
|
| Constructor and Description |
|---|
MonitoredHost() |
| Modifier and Type | Method and Description |
|---|---|
abstract Set<Integer> |
activeVms()
Return the current set of active Java Virtual Machines for this
MonitoredHost.
|
abstract void |
addHostListener(HostListener listener)
Add a HostListener.
|
void |
clearLastException()
Clear the last exception.
|
abstract void |
detach(MonitoredVm vm)
Detach from the indicated MonitoredVm.
|
HostIdentifier |
getHostIdentifier()
Return the resolved HostIdentifier for this MonitoredHost.
|
int |
getInterval()
Get the polling interval.
|
Exception |
getLastException()
Get the last exception encountered while polling this MonitoredHost.
|
static MonitoredHost |
getMonitoredHost(HostIdentifier hostId)
Factory method to construct a MonitoredHost instance to manage the
connection to the host indicated by hostId.
|
static MonitoredHost |
getMonitoredHost(String hostIdString)
Factory method to construct MonitoredHost instances to manage
connections to the host indicated by hostIdString
|
static MonitoredHost |
getMonitoredHost(VmIdentifier vmid)
Factory method to construct a MonitoredHost instance to manage the
connection to the Java Virtual Machine indicated by vmid.
|
abstract MonitoredVm |
getMonitoredVm(VmIdentifier id)
Get the MonitoredVm for the given Java Virtual Machine.
|
abstract MonitoredVm |
getMonitoredVm(VmIdentifier id,
int interval)
Get the MonitoredVm for the given Java Virtual Machine.
|
boolean |
isErrored()
Test if this MonitoredHost is in the errored state.
|
abstract void |
removeHostListener(HostListener listener)
Remove a HostListener.
|
protected static HostIdentifier |
resolveHostId(HostIdentifier hostId)
Method to resolve unspecified components of the given HostIdentifier
by constructing a new HostIdentifier that replaces the unspecified
components with the default values.
|
void |
setInterval(int interval)
Set the polling interval for this MonitoredHost.
|
void |
setLastException(Exception lastException)
Set the last exception encountered while polling this MonitoredHost.
|
protected HostIdentifier hostId
protected int interval
protected Exception lastException
public static MonitoredHost getMonitoredHost(String hostIdString) throws MonitorException, URISyntaxException
hostIdString - a String representation of a HostIdentifierMonitorException - Thrown if monitoring errors occur.URISyntaxException - Thrown when the hostIdString is poorly
formed. This exception may get encapsulated
into MonitorException in a future revision.public static MonitoredHost getMonitoredHost(VmIdentifier vmid) throws MonitorException
vmid - The identifier for the target Java Virtual Machine.MonitorException - Thrown if monitoring errors occur.public static MonitoredHost getMonitoredHost(HostIdentifier hostId) throws MonitorException
hostId - the identifier for the target host.MonitorException - Thrown if monitoring errors occur.protected static HostIdentifier resolveHostId(HostIdentifier hostId) throws MonitorException
hostId - the unresolved HostIdentifier.MonitorException - Thrown if monitoring errors occur.public HostIdentifier getHostIdentifier()
public void setInterval(int interval)
interval - the polling interval, in millisecondspublic int getInterval()
public void setLastException(Exception lastException)
lastException - the last exception encountered;public Exception getLastException()
public void clearLastException()
public boolean isErrored()
public abstract MonitoredVm getMonitoredVm(VmIdentifier id) throws MonitorException
id - the VmIdentifier specifying the target Java Virtual Machine.MonitorException - Thrown if monitoring errors occur.public abstract MonitoredVm getMonitoredVm(VmIdentifier id, int interval) throws MonitorException
id - the VmIdentifier specifying the target Java Virtual Machine.interval - the sampling interval for the target Java Virtual Machine.MonitorException - Thrown if monitoring errors occur.public abstract void detach(MonitoredVm vm) throws MonitorException
vm - the monitored Java Virtual Machine.MonitorException - Thrown if monitoring errors occur.public abstract void addHostListener(HostListener listener) throws MonitorException
listener - the HostListener to add.MonitorException - Thrown if monitoring errors occur.public abstract void removeHostListener(HostListener listener) throws MonitorException
listener - the HostListener to add.MonitorException - Thrown if monitoring errors occur.public abstract Set<Integer> activeVms() throws MonitorException
Integer instances
holding the local virtual machine identifier, or lvmid
for each instrumented Java Virtual Machine currently available.MonitorException - Thrown if monitoring errors occur.Copyright © 2017–2018 earcam. All rights reserved.