edu.utah.janosvm.kit.management.team
Class ResourceMonitor
java.lang.Object
|
+--edu.utah.janosvm.kit.management.team.ResourceMonitor
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- CPUMonitor, MemoryMonitor
- public class ResourceMonitor
- extends java.lang.Object
- implements java.lang.Runnable
Base class for applications that want to poll team's about their resource
consumption. An application is expected to start a thread and execute
the run() method to actually perform the polling.
Constructor Summary |
ResourceMonitor(java.lang.Class sampler)
Construct a ResourceMonitor with the given values. |
ResourceMonitor(int iterations,
long msInterval,
java.lang.Class sampler)
Construct a ResourceMonitor with the given values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ResourceMonitor
public ResourceMonitor(int iterations,
long msInterval,
java.lang.Class sampler)
- Construct a ResourceMonitor with the given values.
- Parameters:
iterations
- The number of times to poll.msInterval
- The millisecond interval between polls.sampler
- The class used to sample the state of a team.
ResourceMonitor
public ResourceMonitor(java.lang.Class sampler)
- Construct a ResourceMonitor with the given values. The default
iteration count is infinite and the default interval is one second.
- Parameters:
sampler
- The class used to sample the state of a team.
addTeams
public ResourceMonitor addTeams(java.lang.String[] names)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException
- Add a number of teams that should be monitored.
- Parameters:
names
- The names of the teams to monitor.- Returns:
- this
run
public void run()
- Poll the teams.
- Specified by:
run
in interface java.lang.Runnable
beginSampling
public void beginSampling()
endSampling
public void endSampling()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003