Jvmstat

sun.jvmstat.perfdata.monitor.protocol.local
Class MonitoredHostProvider

java.lang.Object
  extended by sun.jvmstat.monitor.MonitoredHost
      extended by sun.jvmstat.perfdata.monitor.protocol.local.MonitoredHostProvider

public class MonitoredHostProvider
extends MonitoredHost

Concrete implementation of the MonitoredHost interface for the local protocol of the HotSpot PerfData monitoring implementation.

Since:
1.5

Field Summary
 
Fields inherited from class sun.jvmstat.monitor.MonitoredHost
hostId, interval, lastException
 
Constructor Summary
MonitoredHostProvider(HostIdentifier hostId)
          Create a MonitoredHostProvider instance using the given HostIdentifier.
 
Method Summary
 Set activeVms()
          Return the current set of active Java Virtual Machines for this MonitoredHost.
 void addHostListener(HostListener listener)
          Add a HostListener.
 void detach(MonitoredVm vm)
          Detach from the indicated MonitoredVm.
 MonitoredVm getMonitoredVm(VmIdentifier vmid)
          Get the MonitoredVm for the given Java Virtual Machine.
 MonitoredVm getMonitoredVm(VmIdentifier vmid, int interval)
          Get the MonitoredVm for the given Java Virtual Machine.
 void removeHostListener(HostListener listener)
          Remove a HostListener.
 void setInterval(int newInterval)
          Set the polling interval for this MonitoredHost.
 
Methods inherited from class sun.jvmstat.monitor.MonitoredHost
clearLastException, getHostIdentifier, getInterval, getLastException, getMonitoredHost, getMonitoredHost, getMonitoredHost, isErrored, resolveHostId, setLastException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonitoredHostProvider

public MonitoredHostProvider(HostIdentifier hostId)
Create a MonitoredHostProvider instance using the given HostIdentifier.

Parameters:
hostId - the host identifier for this MonitoredHost
Method Detail

getMonitoredVm

public MonitoredVm getMonitoredVm(VmIdentifier vmid)
                           throws MonitorException
Get the MonitoredVm for the given Java Virtual Machine. The default sampling interval is used for the MonitoredVm instance.

Specified by:
getMonitoredVm in class MonitoredHost
Parameters:
vmid - the VmIdentifier specifying the target Java Virtual Machine.
Returns:
MonitoredVm - the MonitoredVm instance for the target Java Virtual Machine.
Throws:
MonitorException - Thrown if monitoring errors occur.

getMonitoredVm

public MonitoredVm getMonitoredVm(VmIdentifier vmid,
                                  int interval)
                           throws MonitorException
Get the MonitoredVm for the given Java Virtual Machine. The sampling interval is set to the given interval.

Specified by:
getMonitoredVm in class MonitoredHost
Parameters:
vmid - the VmIdentifier specifying the target Java Virtual Machine.
interval - the sampling interval for the target Java Virtual Machine.
Returns:
MonitoredVm - the MonitoredVm instance for the target Java Virtual Machine.
Throws:
MonitorException - Thrown if monitoring errors occur.

detach

public void detach(MonitoredVm vm)
Detach from the indicated MonitoredVm.

Specified by:
detach in class MonitoredHost
Parameters:
vm - the monitored Java Virtual Machine.

addHostListener

public void addHostListener(HostListener listener)
Add a HostListener. The given listener is added to the list of HostListener objects to be notified of MonitoredHost related events.

Specified by:
addHostListener in class MonitoredHost
Parameters:
listener - the HostListener to add.

removeHostListener

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

Specified by:
removeHostListener in class MonitoredHost
Parameters:
listener - the HostListener to add.

setInterval

public void setInterval(int newInterval)
Set the polling interval for this MonitoredHost.

Overrides:
setInterval in class MonitoredHost
Parameters:
newInterval - the polling interval, in milliseconds

activeVms

public Set 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.

Specified by:
activeVms in class MonitoredHost
Returns:
Set - the current set of active Java Virtual Machines associated with this MonitoredHost, or the empty set of none.

Jvmstat