Monitor.Omr
Class SuspendMonitor
java.lang.Object
|
+--Monitor.Omr.SuspendMonitor
- public class SuspendMonitor
- extends java.lang.Object
Suspends and resumes the monitoring thread in response to user requests.
This class encapsulates a boolean variable called is_suspended
that is set to true
when the user calls the Suspend
method of the Monitor/Omr/Rmo interface and is set to false
when the user calls the Resume
method. The monitor thread
checks the value of this variable using the method is_montor_suspended
and calls wait
if its value is true
.
When Resume
is called by the user, a notify
is
issued and the monitored thread is resumed.
Constructor Summary |
SuspendMonitor()
Initialize is_suspended with false . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SuspendMonitor
public SuspendMonitor()
- Initialize
is_suspended
with false
.
is_monitor_suspended
public void is_monitor_suspended()
- Suspends the monitor if the user called the
Suspend
method
of the Monitor/Omr/Rmo interface.
This method is called by the monitoring thread. If is_suspended
is true
it suspends the monitoring thread using the
wait
method.
suspend_monitor
public void suspend_monitor()
- Set
is_suspended
to true
.
When the user calls the Suspend
method of the
Monitor/Omr/Rmo interface, the servant calls this method
that sets is_suspended
to true
.
unsuspend_monitor
public void unsuspend_monitor()
- Resume the monitoring thread.
When the user calls the
Resume
method of the
Monitor/Omr/Rmo interface, the servant calls this method
that sets is_suspended
to false
and
resumes the monitoring thread using the notify
method.