java.lang.Object
java.lang.management.LockInfo
java.lang.management.MonitorInfo
This class represents information about objects locked via
a synchronized method or block.
- Since:
- 1.6
-
Constructor Summary
ConstructorsConstructorDescriptionMonitorInfo
(String className, int identityHashCode, int stackDepth, StackTraceElement stackFrame) Creates a newMonitorInfo
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic MonitorInfo
from
(CompositeData cd) Receives aCompositeData
representing aMonitorInfo
object and attempts to return the rootMonitorInfo
instance.int
Returns an integer which is the number of frames deep into the stack where the monitor locking took place.The completeStackTraceElement
in which the monitor was locked.Methods declared in class java.lang.management.LockInfo
getClassName, getIdentityHashCode, toString
-
Constructor Details
-
MonitorInfo
public MonitorInfo(String className, int identityHashCode, int stackDepth, StackTraceElement stackFrame) Creates a newMonitorInfo
instance.- Parameters:
className
- the name (including the package prefix) of the associated monitor lock object's classidentityHashCode
- the value of the associated monitor lock object's identity hash code. This amounts to the result of callingSystem.identityHashCode(Object)
with the monitor lock object as the sole argument.stackDepth
- the number of frames deep in the stack where the locking of the monitor took placestackFrame
- the complete stack frame at which the locking of the monitor occurred- Throws:
IllegalArgumentException
- if either of the following two conditions apply:- the supplied
stackFrame
is non-null
yet the value ofstackDepth
is less than zero - the supplied
stackFrame
isnull
yet the value ofstackDepth
is zero or greater
- the supplied
-
-
Method Details
-
getLockedStackDepth
public int getLockedStackDepth()Returns an integer which is the number of frames deep into the stack where the monitor locking took place.- Returns:
- the number of frames into the stack trace at which point the monitor object locking too place
-
getLockedStackFrame
The completeStackTraceElement
in which the monitor was locked.- Returns:
- the
StackTraceElement
in which the associated monitor was locked
-
from
Receives aCompositeData
representing aMonitorInfo
object and attempts to return the rootMonitorInfo
instance.- Parameters:
cd
- aCompositeData
that represents aMonitorInfo
.- Returns:
- if
cd
is non-null
, returns a new instance ofMonitorInfo
. Ifcd
isnull
, returnsnull
. - Throws:
IllegalArgumentException
- if argumentcd
does not correspond to aMonitorInfo
with the expected attributes of aLockInfo
-className
(java.lang.String
) andidentityHashCode
(java.lang.Integer
) - plus the following:lockedStackFrame
(javax.management.openmbean.CompositeData
)lockedStackDepth
(java.lang.Integer
)
lockedStackFrame
attribute must correspond to ajava.lang.StackTraceElement
which has the following attributes:moduleName
(java.lang.String
)moduleVersion
(java.lang.String
)className
(java.lang.String
)methodName
(java.lang.String
)fileName
(java.lang.String
)lineNumber
(java.lang.Integer
)nativeMethod
(java.lang.Boolean
)
-