-
public interface JavaMonitorRepresents a Java monitor (either an object monitor or a raw monitor).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(Object obj)Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.IteratorgetEnterWaiters()Get the set of threads waiting to enter the monitorImagePointergetID()Get the identifier for this monitorStringgetName()Note that the name of a JavaMonitor is not necessarily meaningful but is provided here as it is usually present in the running VM.IteratorgetNotifyWaiters()Get the set of threads waiting to be notified on the monitor (in the Object.wait method)JavaObjectgetObject()Get the object associated with this monitor.JavaThreadgetOwner()Get the thread which currently owns the monitorinthashCode()Answers an integer hash code for the receiver.
-
-
-
Method Detail
-
getObject
JavaObject getObject()
Get the object associated with this monitor.- Returns:
- the object associated with this monitor, or null if this is a raw monitor or a valid object could not be retrieved.
-
getName
String getName() throws CorruptDataException
Note that the name of a JavaMonitor is not necessarily meaningful but is provided here as it is usually present in the running VM. If there is no name for the monitor a synthetic name will be created by DTFJ.- Returns:
- the name of the monitor (never null)
- Throws:
CorruptDataException
-
getOwner
JavaThread getOwner() throws CorruptDataException
Get the thread which currently owns the monitor- Returns:
- the owner of the monitor, or null if the monitor is unowned
- Throws:
CorruptDataException
-
getEnterWaiters
Iterator getEnterWaiters()
Get the set of threads waiting to enter the monitor- Returns:
- an iterator over the collection of threads waiting to enter this monitor
- See Also:
JavaThread,CorruptData
-
getNotifyWaiters
Iterator getNotifyWaiters()
Get the set of threads waiting to be notified on the monitor (in the Object.wait method)- Returns:
- an iterator over the collection of threads waiting to be notified on this monitor
- See Also:
JavaThread,CorruptData
-
getID
ImagePointer getID()
Get the identifier for this monitor- Returns:
- The pointer which uniquely identifies this monitor in memory.
-
equals
boolean equals(Object obj)
Description copied from class:ObjectCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).- Overrides:
equalsin classObject- Parameters:
obj-- Returns:
- True if the given object refers to the same Java Monitor in the image
- See Also:
Object.hashCode()
-
hashCode
int hashCode()
Description copied from class:ObjectAnswers an integer hash code for the receiver. Any two objects which answertruewhen passed to.equalsmust answer the same value for this method.- Overrides:
hashCodein classObject- Returns:
- the receiver's hash.
- See Also:
Object.equals(java.lang.Object)
-
-