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

public Class MonitoredHostProvider

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

Concrete implementation of the MonitoredHost interface for the rmi 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 remote machine and generate local event notifications.

Field Summary

Modifier and TypeField and Description
private HashSet<Integer>
private static final int
private ArrayList<HostListener>
private RemoteHost
private static final String
private MonitoredHostProvider.NotifierTask
private Timer
private RemoteVmManager
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.

pack-priv void
fireDisconnectedEvents()

Fire hostDisconnectEvent events.

private void
fireVmStatusChangedEvents(Set<Integer>
Set of Integer objects containing the local Vm Identifiers of the active JVMs
active
,
Set<Integer>
Set of Integer objects containing the local Vm Identifiers of new JVMs started since last interval.
started
,
Set<Integer>
Set of Integer objects containing the local Vm Identifiers of terminated JVMs since last interval.
terminated
)

Fire VmStatusChangeEvent events to HostListener objects

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
remoteHostback to summary
private RemoteHost remoteHost
serverNameback to summary
private static final String serverName
taskback to summary
private MonitoredHostProvider.NotifierTask task
timerback to summary
private Timer timer
vmManagerback to summary
private RemoteVmManager vmManager

Constructor Detail

MonitoredHostProviderback to summary
public MonitoredHostProvider(HostIdentifier hostId) throws MonitorException

Create a MonitoredHostProvider instance using the given HostIdentifier.

Parameters
hostId:HostIdentifier

the host identifier for this MonitoredHost

Exceptions
MonitorException:
Thrown on any error encountered while communicating with the remote host.

Method Detail

activeVmsback to summary
public Set<Integer> activeVms() throws MonitorException

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.

Exceptions
MonitorException:
Thrown if monitoring errors occur.
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) throws MonitorException

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

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

Detach from the indicated MonitoredVm.

Exceptions
MonitorException:
Thrown if monitoring errors occur.
fireDisconnectedEventsback to summary
pack-priv void fireDisconnectedEvents()

Fire hostDisconnectEvent events.

Annotations
@SuppressWarnings:unchecked
fireVmStatusChangedEventsback to summary
private void fireVmStatusChangedEvents(Set<Integer> active, Set<Integer> started, Set<Integer> terminated)

Fire VmStatusChangeEvent events to HostListener objects

Parameters
active:Set<Integer>

Set of Integer objects containing the local Vm Identifiers of the active JVMs

started:Set<Integer>

Set of Integer objects containing the local Vm Identifiers of new JVMs started since last interval.

terminated:Set<Integer>

Set of Integer objects containing the local Vm Identifiers of terminated JVMs 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.rmi back to summary

private Class MonitoredHostProvider.NotifierTask

extends CountedTimerTask
Class Inheritance

class to poll the remote machine and generate local 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.