java.lang.Object javax.realtime.MonitorControl
public abstract class MonitorControl
Abstract superclass for all monitor control policy objects.
Constructor Summary | |
---|---|
protected |
MonitorControl()
Invoked from subclass constructors. |
Method Summary | |
---|---|
static MonitorControl |
getMonitorControl()
Gets the current default monitor control policy. |
static MonitorControl |
getMonitorControl(java.lang.Object obj)
Gets the monitor control policy of the given instance of Object . |
static MonitorControl |
setMonitorControl(MonitorControl policy)
Sets the default monitor control policy. |
static MonitorControl |
setMonitorControl(java.lang.Object obj,
MonitorControl policy)
Immediately sets policy as the monitor control policy for
obj . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected MonitorControl()
Method Detail |
---|
public static MonitorControl getMonitorControl(java.lang.Object obj)
Object
.
obj
- The object being queried.
obj
parameter.
java.lang.IllegalArgumentException
- Thrown if obj
is null.public static MonitorControl getMonitorControl()
public static MonitorControl setMonitorControl(MonitorControl policy)
setMonitorControl(Object, MonitorControl)
,
the setting of the default monitor control policy occurs immediately.
policy
- The new monitor control policy. If null nothing happens.
MonitorControl
policy that was replaced.
java.lang.SecurityException
- Thrown if the caller is not permitted to alter
the default monitor control policy.
java.lang.IllegalArgumentException
- Thrown if policy
is
not in immortal memory.
java.lang.UnsupportedOperationException
- Thrown if policy
is not
a supported monitor control policy.MonitorControl
.public static MonitorControl setMonitorControl(java.lang.Object obj, MonitorControl policy)
policy
as the monitor control policy for
obj
.
A thread or schedulable object that is queued for the lock associated
with obj
, or is in obj
's wait set, is not rechecked (e.g.,
for a CeilingViolationException
) under policy
, either as
part of the execution of setMonitorControl
or when it is awakened
to (re)acquire the lock.
The thread or schedulable object invoking setMonitorControl
must
already hold the lock on obj
.
obj
- The object that will be governed by the new policy.policy
- The new policy for the object. If null nothing will happen.
MonitorControl
policy for
obj
, which will be replaced.
java.lang.IllegalArgumentException
- Thrown when obj
is null or policy
is
not in immortal memory.
java.lang.UnsupportedOperationException
- Thrown if policy
is not
a supported monitor control policy.
java.lang.IllegalMonitorStateException
- Thrown if the caller does not hold a lock
on obj
.MonitorControl
.