Jvmstat

sun.jvmstat.perfdata.monitor.protocol.rmi
Class RemoteMonitoredVm

java.lang.Object
  extended by sun.jvmstat.perfdata.monitor.AbstractMonitoredVm
      extended by sun.jvmstat.perfdata.monitor.protocol.rmi.RemoteMonitoredVm
All Implemented Interfaces:
MonitoredVm, BufferedMonitoredVm

public class RemoteMonitoredVm
extends AbstractMonitoredVm

Concrete implementation of the AbstractMonitoredVm class for the rmi: protocol for the HotSpot PerfData monitoring implementation.

This class provides the ability to acquire to the instrumentation buffer of a live, remote target Java Virtual Machine through an RMI server.

Since:
1.5

Field Summary
 
Fields inherited from class sun.jvmstat.perfdata.monitor.AbstractMonitoredVm
interval, pdb, vmid
 
Constructor Summary
RemoteMonitoredVm(RemoteVm rvm, VmIdentifier vmid, Timer timer, int interval)
          Create a RemoteMonitoredVm instance.
 
Method Summary
 void addVmListener(VmListener l)
          Add a VmListener.
 void attach()
          Method to attach to the remote MonitoredVm.
 void detach()
          Detach from target Java Virtual Machine.
 RemoteVm getRemoteVm()
          Get the proxy to the remote MonitoredVm.
 void removeVmListener(VmListener l)
          Remove a VmListener.
 void sample()
          Get a copy of the remote instrumentation buffer.
 void setInterval(int newInterval)
          Set the polling interval to interval milliseconds.
 
Methods inherited from class sun.jvmstat.perfdata.monitor.AbstractMonitoredVm
clearLastException, findByName, findByPattern, getBytes, getCapacity, getInterval, getLastException, getMonitorStatus, getVmIdentifier, isErrored, setLastException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteMonitoredVm

public RemoteMonitoredVm(RemoteVm rvm,
                         VmIdentifier vmid,
                         Timer timer,
                         int interval)
                  throws MonitorException
Create a RemoteMonitoredVm instance.

Parameters:
rvm - the proxy to the remote MonitoredVm instance.
vmid - the vm identifier specifying the remot target JVM
timer - the timer used to run polling tasks
interval - the sampling interval
Throws:
MonitorException
Method Detail

attach

public void attach()
            throws MonitorException
Method to attach to the remote MonitoredVm.

Throws:
MonitorException

detach

public void detach()
Detach from target Java Virtual Machine. After calling this method, updates of the instrumentation data values may be halted. All event notifications are halted. Further interactions with this object should be avoided.

Specified by:
detach in interface MonitoredVm
Overrides:
detach in class AbstractMonitoredVm

sample

public void sample()
            throws RemoteException
Get a copy of the remote instrumentation buffer.

The data in the remote instrumentation buffer is copied into a local byte buffer.

Throws:
RemoteException - Thrown on any communications errors with the remote system.

getRemoteVm

public RemoteVm getRemoteVm()
Get the proxy to the remote MonitoredVm.

Returns:
RemoteVm - the proxy to the remote MonitoredVm.

addVmListener

public void addVmListener(VmListener l)
Add a VmListener. The given listener is added to the list of VmListener objects to be notified of MonitoredVm related events.

Specified by:
addVmListener in interface MonitoredVm
Specified by:
addVmListener in class AbstractMonitoredVm
Parameters:
l - the VmListener to add.

removeVmListener

public void removeVmListener(VmListener l)
Remove a VmListener. The given listener is removed from the list of VmListener objects to be notified of MonitoredVm related events.

Specified by:
removeVmListener in interface MonitoredVm
Specified by:
removeVmListener in class AbstractMonitoredVm
Parameters:
l - the VmListener to be removed.

setInterval

public void setInterval(int newInterval)
Set the polling interval to interval milliseconds. Polling based monitoring implementations need to refresh the instrumentation data on a periodic basis. This interface allows the interval to override the implementation specific default interval.

Specified by:
setInterval in interface MonitoredVm
Overrides:
setInterval in class AbstractMonitoredVm
Parameters:
newInterval - the polling interval in milliseconds

Jvmstat