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

public Class RemoteMonitoredVm

extends AbstractMonitoredVm
Class Inheritance
Imports
sun.jvmstat.monitor.*, sun.jvmstat.monitor.event.*, sun.jvmstat.monitor.remote.*, sun.jvmstat.perfdata.monitor.*, java.lang.reflect.*, java.util.*, java.io.*, java.nio.ByteBuffer, java.rmi.*

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.

Author
Brian Doherty
Since
1.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
RemoteMonitoredVm.NotifierTask

Class to periodically check the state of the defined monitors for the remote MonitoredVm instance and to notify listeners of any detected changes.

private class
RemoteMonitoredVm.SamplerTask

Class to periodically sample the remote instrumentation byte buffer and refresh the local copy.

Field Summary

Modifier and TypeField and Description
private ArrayList<VmListener>
private RemoteMonitoredVm.NotifierTask
private RemoteVm
private RemoteMonitoredVm.SamplerTask
private Timer
private ByteBuffer
Inherited from sun.jvmstat.perfdata.monitor.AbstractMonitoredVm:
intervalpdbvmid

Constructor Summary

AccessConstructor and Description
public
RemoteMonitoredVm(RemoteVm
the proxy to the remote MonitoredVm instance.
rvm
,
VmIdentifier
the vm identifier specifying the remot target JVM
vmid
,
Timer
the timer used to run polling tasks
timer
,
int
the sampling interval
interval
)

Create a RemoteMonitoredVm instance.

Method Summary

Modifier and TypeMethod and Description
public void
public void
attach()

Method to attach to the remote MonitoredVm.

public void
detach()

Overrides sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.detach.

Implements sun.jvmstat.monitor.MonitoredVm.detach.

Detach from target Java Virtual Machine.

pack-priv void
fireMonitorStatusChangedEvents(List<Monitor>
List of Monitor objects inserted.
inserted
,
List<Monitor>
List of Monitor objects removed.
removed
)

Fire MonitoredVmStructureChanged events.

pack-priv void
fireMonitorsUpdatedEvents()

Fire MonitoredVmStructureChanged events.

public RemoteVm

Returns:

RemoteVm - the proxy to the remote MonitoredVm.
getRemoteVm
()

Get the proxy to the remote MonitoredVm.

public void
public void
sample()

Get a copy of the remote instrumentation buffer.

public void
setInterval(int newInterval)

Overrides sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.setInterval.

Implements sun.jvmstat.monitor.MonitoredVm.setInterval.

Set the polling interval to interval milliseconds.

Inherited from sun.jvmstat.perfdata.monitor.AbstractMonitoredVm:
clearLastExceptionfindByNamefindByPatterngetBytesgetCapacitygetIntervalgetLastExceptiongetMonitorStatusgetVmIdentifierisErroredsetLastException

Field Detail

listenersback to summary
private ArrayList<VmListener> listeners
notifierTaskback to summary
private RemoteMonitoredVm.NotifierTask notifierTask
rvmback to summary
private RemoteVm rvm
samplerTaskback to summary
private RemoteMonitoredVm.SamplerTask samplerTask
timerback to summary
private Timer timer
updateBufferback to summary
private ByteBuffer updateBuffer

Constructor Detail

RemoteMonitoredVmback to summary
public RemoteMonitoredVm(RemoteVm rvm, VmIdentifier vmid, Timer timer, int interval) throws MonitorException

Create a RemoteMonitoredVm instance.

Parameters
rvm:RemoteVm

the proxy to the remote MonitoredVm instance.

vmid:VmIdentifier

the vm identifier specifying the remot target JVM

timer:Timer

the timer used to run polling tasks

interval:int

the sampling interval

Method Detail

addVmListenerback to summary
public void addVmListener(VmListener l)

Implements abstract sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.addVmListener.

Implements sun.jvmstat.monitor.MonitoredVm.addVmListener.

Doc from sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.addVmListener.

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

attachback to summary
public void attach() throws MonitorException

Method to attach to the remote MonitoredVm.

detachback to summary
public void detach()

Overrides sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.detach.

Implements sun.jvmstat.monitor.MonitoredVm.detach.

Doc from sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.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.

fireMonitorStatusChangedEventsback to summary
pack-priv void fireMonitorStatusChangedEvents(List<Monitor> inserted, List<Monitor> removed)

Fire MonitoredVmStructureChanged events.

Parameters
inserted:List<Monitor>

List of Monitor objects inserted.

removed:List<Monitor>

List of Monitor objects removed.

Annotations
@SuppressWarnings:unchecked
fireMonitorsUpdatedEventsback to summary
pack-priv void fireMonitorsUpdatedEvents()

Fire MonitoredVmStructureChanged events.

Annotations
@SuppressWarnings:unchecked
getRemoteVmback to summary
public RemoteVm getRemoteVm()

Get the proxy to the remote MonitoredVm.

Returns:RemoteVm

RemoteVm - the proxy to the remote MonitoredVm.

removeVmListenerback to summary
public void removeVmListener(VmListener l)

Implements abstract sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.removeVmListener.

Implements sun.jvmstat.monitor.MonitoredVm.removeVmListener.

Doc from sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.removeVmListener.

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

sampleback to summary
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.

Exceptions
RemoteException:
Thrown on any communications errors with the remote system.
setIntervalback to summary
public void setInterval(int newInterval)

Overrides sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.setInterval.

Implements sun.jvmstat.monitor.MonitoredVm.setInterval.

Doc from sun.jvmstat.perfdata.monitor.AbstractMonitoredVm.setInterval.

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.

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

private Class RemoteMonitoredVm.NotifierTask

extends CountedTimerTask
Class Inheritance

Class to periodically check the state of the defined monitors for the remote MonitoredVm instance and to notify listeners of any detected changes.

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.

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

private Class RemoteMonitoredVm.SamplerTask

extends CountedTimerTask
Class Inheritance

Class to periodically sample the remote instrumentation byte buffer and refresh the local copy. Registered listeners are notified of the completion of a sampling event.

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

SamplerTaskback to summary
private SamplerTask()

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.