APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.jvmstat.perfdata.monitor.protocol.local

public Class MonitoredHostProvider

extends MonitoredHost
Class Inheritance
Imports
sun.jvmstat.monitor.*, sun.jvmstat.monitor.event.*, sun.jvmstat.perfdata.monitor.*, java.util.*, java.net.*

Concrete implementation of the MonitoredHost interface for the local protocol of the HotSpot PerfData monitoring implementation.
Author
Brian Doherty
Since
1.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
MonitoredHostProvider.NotifierTask

Class to poll the local system and generate event notifications.

Field Summary

Modifier and TypeField and Description
private HashSet<Integer>
private static final int
private ArrayList<HostListener>
private MonitoredHostProvider.NotifierTask
private LocalVmManager
Inherited from sun.jvmstat.monitor.MonitoredHost:
hostIdintervallastException

Constructor Summary

AccessConstructor and Description
public
MonitoredHostProvider(HostIdentifier
the host identifier for this MonitoredHost
hostId
)

Create a MonitoredHostProvider instance using the given HostIdentifier.

Method Summary

Modifier and TypeMethod and Description
public Set<Integer>
activeVms()

Implements abstract sun.jvmstat.monitor.MonitoredHost.activeVms.

Return the current set of active Java Virtual Machines for this MonitoredHost.

public void
addHostListener(HostListener listener)

Implements abstract sun.jvmstat.monitor.MonitoredHost.addHostListener.

Add a HostListener.

public void
detach(MonitoredVm vm)

Implements abstract sun.jvmstat.monitor.MonitoredHost.detach.

Detach from the indicated MonitoredVm.

private void
fireVmStatusChangedEvents(Set<Integer>
a set of Integer objects containing the vmid of the active Vms
active
,
Set<Integer>
a set of Integer objects containing the vmid of new Vms started since last interval.
started
,
Set<Integer>
a set of Integer objects containing the vmid of terminated Vms since last interval.
terminated
)

Fire VmEvent events.

public MonitoredVm
getMonitoredVm(VmIdentifier vmid)

Implements abstract sun.jvmstat.monitor.MonitoredHost.getMonitoredVm.

Get the MonitoredVm for the given Java Virtual Machine.

public MonitoredVm
getMonitoredVm(VmIdentifier vmid, int interval)

Implements abstract sun.jvmstat.monitor.MonitoredHost.getMonitoredVm.

Get the MonitoredVm for the given Java Virtual Machine.

public void
removeHostListener(HostListener listener)

Implements abstract sun.jvmstat.monitor.MonitoredHost.removeHostListener.

Remove a HostListener.

public void
setInterval(int newInterval)

Overrides sun.jvmstat.monitor.MonitoredHost.setInterval.

Set the polling interval for this MonitoredHost.

Inherited from sun.jvmstat.monitor.MonitoredHost:
clearLastExceptiongetHostIdentifiergetIntervalgetLastExceptiongetMonitoredHostgetMonitoredHostgetMonitoredHostisErroredresolveHostIdsetLastException

Field Detail

activeVmsback to summary
private HashSet<Integer> activeVms
DEFAULT_POLLING_INTERVALback to summary
private static final int DEFAULT_POLLING_INTERVAL
listenersback to summary
private ArrayList<HostListener> listeners
taskback to summary
private MonitoredHostProvider.NotifierTask task
vmManagerback to summary
private LocalVmManager vmManager

Constructor Detail

MonitoredHostProviderback to summary
public MonitoredHostProvider(HostIdentifier hostId)

Create a MonitoredHostProvider instance using the given HostIdentifier.

Parameters
hostId:HostIdentifier

the host identifier for this MonitoredHost

Method Detail

activeVmsback to summary
public Set<Integer> activeVms()

Implements abstract sun.jvmstat.monitor.MonitoredHost.activeVms.

Doc from sun.jvmstat.monitor.MonitoredHost.activeVms.

Return the current set of active Java Virtual Machines for this MonitoredHost. The returned Set contains Integer instances holding the local virtual machine identifier, or lvmid for each instrumented Java Virtual Machine currently available.

addHostListenerback to summary
public void addHostListener(HostListener listener)

Implements abstract sun.jvmstat.monitor.MonitoredHost.addHostListener.

Doc from sun.jvmstat.monitor.MonitoredHost.addHostListener.

Add a HostListener. The given listener is added to the list of HostListener objects to be notified of MonitoredHost related events.

detachback to summary
public void detach(MonitoredVm vm)

Implements abstract sun.jvmstat.monitor.MonitoredHost.detach.

Doc from sun.jvmstat.monitor.MonitoredHost.detach.

Detach from the indicated MonitoredVm.

fireVmStatusChangedEventsback to summary
private void fireVmStatusChangedEvents(Set<Integer> active, Set<Integer> started, Set<Integer> terminated)

Fire VmEvent events.

Parameters
active:Set<Integer>

a set of Integer objects containing the vmid of the active Vms

started:Set<Integer>

a set of Integer objects containing the vmid of new Vms started since last interval.

terminated:Set<Integer>

a set of Integer objects containing the vmid of terminated Vms since last interval.

Annotations
@SuppressWarnings:unchecked
getMonitoredVmback to summary
public MonitoredVm getMonitoredVm(VmIdentifier vmid) throws MonitorException

Implements abstract sun.jvmstat.monitor.MonitoredHost.getMonitoredVm.

Doc from sun.jvmstat.monitor.MonitoredHost.getMonitoredVm.

Get the MonitoredVm for the given Java Virtual Machine. The default sampling interval is used for the MonitoredVm instance.

Exceptions
MonitorException:
Thrown if monitoring errors occur.
getMonitoredVmback to summary
public MonitoredVm getMonitoredVm(VmIdentifier vmid, int interval) throws MonitorException

Implements abstract sun.jvmstat.monitor.MonitoredHost.getMonitoredVm.

Doc from sun.jvmstat.monitor.MonitoredHost.getMonitoredVm.

Get the MonitoredVm for the given Java Virtual Machine. The sampling interval is set to the given interval.

Exceptions
MonitorException:
Thrown if monitoring errors occur.
removeHostListenerback to summary
public void removeHostListener(HostListener listener)

Implements abstract sun.jvmstat.monitor.MonitoredHost.removeHostListener.

Doc from sun.jvmstat.monitor.MonitoredHost.removeHostListener.

Remove a HostListener. The given listener is removed from the list of HostListener objects to be notified of MonitoredHost related events.

setIntervalback to summary
public void setInterval(int newInterval)

Overrides sun.jvmstat.monitor.MonitoredHost.setInterval.

Doc from sun.jvmstat.monitor.MonitoredHost.setInterval.

Set the polling interval for this MonitoredHost.

sun.jvmstat.perfdata.monitor.protocol.local back to summary

private Class MonitoredHostProvider.NotifierTask

extends CountedTimerTask
Class Inheritance

Class to poll the local system and generate event notifications.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
run()

Overrides sun.jvmstat.perfdata.monitor.CountedTimerTask.run.

Implements java.lang.Runnable.run.

The action to be performed by this timer task.

Inherited from sun.jvmstat.perfdata.monitor.CountedTimerTask:
executionCount

Constructor Detail

NotifierTaskback to summary
private NotifierTask()

Method Detail

runback to summary
public void run()

Overrides sun.jvmstat.perfdata.monitor.CountedTimerTask.run.

Implements java.lang.Runnable.run.

Doc from java.util.TimerTask.run.

The action to be performed by this timer task.