java.lang.Object
com.ibm.dtfj.java.j9.JavaMonitor
- All Implemented Interfaces:
JavaMonitor
-
Constructor Summary
ConstructorDescriptionJavaMonitor
(JavaRuntime runtime, ImagePointer pointer, String name, ImagePointer encompassingObjectAddress, long owningThread) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBlockedThread
(JavaThread thread) void
addWaitingThread
(JavaThread thread) boolean
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.Get the set of threads waiting to enter the monitorgetID()
Get the identifier for this monitorgetName()
Note that the name of a JavaMonitor is not necessarily meaningful but is provided here as it is usually present in the running VM.Get the set of threads waiting to be notified on the monitor (in the Object.wait method)Get the object associated with this monitor.getOwner()
Get the thread which currently owns the monitorint
hashCode()
Answers an integer hash code for the receiver.
-
Constructor Details
-
JavaMonitor
public JavaMonitor(JavaRuntime runtime, ImagePointer pointer, String name, ImagePointer encompassingObjectAddress, long owningThread)
-
-
Method Details
-
getObject
Description copied from interface:JavaMonitor
Get the object associated with this monitor.- Specified by:
getObject
in interfaceJavaMonitor
- Returns:
- the object associated with this monitor, or null if this is a raw monitor or a valid object could not be retrieved.
-
getName
Description copied from interface:JavaMonitor
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.- Specified by:
getName
in interfaceJavaMonitor
- Returns:
- the name of the monitor (never null)
- Throws:
CorruptDataException
-
getOwner
Description copied from interface:JavaMonitor
Get the thread which currently owns the monitor- Specified by:
getOwner
in interfaceJavaMonitor
- Returns:
- the owner of the monitor, or null if the monitor is unowned
- Throws:
CorruptDataException
-
getEnterWaiters
Description copied from interface:JavaMonitor
Get the set of threads waiting to enter the monitor- Specified by:
getEnterWaiters
in interfaceJavaMonitor
- Returns:
- an iterator over the collection of threads waiting to enter this monitor
- See Also:
-
getNotifyWaiters
Description copied from interface:JavaMonitor
Get the set of threads waiting to be notified on the monitor (in the Object.wait method)- Specified by:
getNotifyWaiters
in interfaceJavaMonitor
- Returns:
- an iterator over the collection of threads waiting to be notified on this monitor
- See Also:
-
equals
Description copied from class:java.lang.Object
Compares 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 (==).- Specified by:
equals
in interfaceJavaMonitor
- Overrides:
equals
in classObject
- Parameters:
obj
- Object the object to compare with this object.- Returns:
- boolean
true
if the object is the same as this objectfalse
if it is different from this object. - See Also:
-
hashCode
public int hashCode()Description copied from class:java.lang.Object
Answers an integer hash code for the receiver. Any two objects which answertrue
when passed to.equals
must answer the same value for this method.- Specified by:
hashCode
in interfaceJavaMonitor
- Overrides:
hashCode
in classObject
- Returns:
- the receiver's hash.
- See Also:
-
getID
Description copied from interface:JavaMonitor
Get the identifier for this monitor- Specified by:
getID
in interfaceJavaMonitor
- Returns:
- The pointer which uniquely identifies this monitor in memory.
-
addBlockedThread
-
addWaitingThread
-