APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang.management

public Class LockInfo

extends Object
Class Inheritance
Known Direct Subclasses
java.lang.management.MonitorInfo
Imports
javax.management.openmbean.CompositeData, java.util.concurrent.locks.*, sun.management.LockInfoCompositeData

Information about a lock. A lock can be a built-in object monitor, an ownable synchronizer, or the Condition object associated with synchronizers.

An ownable synchronizer is a synchronizer that may be exclusively owned by a thread and uses AbstractOwnableSynchronizer (or its subclass) to implement its synchronization property. ReentrantLock and the write-lock (but not the read-lock) of ReentrantReadWriteLock are two examples of ownable synchronizers provided by the platform.

MXBean Mapping

LockInfo is mapped to a CompositeData as specified in the from method.
Author
Mandy Chung
Since
1.6
See Also
java.util.concurrent.locks.AbstractOwnableSynchronizer, java.util.concurrent.locks.Condition

Field Summary

Modifier and TypeField and Description
private String
private int

Constructor Summary

AccessConstructor and Description
public
LockInfo(String
the fully qualified name of the class of the lock object.
className
,
int
the identity hash code of the lock object.
identityHashCode
)

Constructs a LockInfo object.

pack-priv
LockInfo(Object lock)

package-private constructors

Method Summary

Modifier and TypeMethod and Description
public static LockInfo

Returns:

a LockInfo object represented by cd if cd is not null; null otherwise.
from
(CompositeData
CompositeData representing a LockInfo
cd
)

Returns a LockInfo object represented by the given CompositeData.

public String

Returns:

the fully qualified name of the class of the lock object.
getClassName
()

Returns the fully qualified name of the class of the lock object.

public int

Returns:

the identity hash code of the lock object.
getIdentityHashCode
()

Returns the identity hash code of the lock object returned from the System#identityHashCode method.

public String

Returns:

the string representation of a lock.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of a lock.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

classNameback to summary
private String className
identityHashCodeback to summary
private int identityHashCode

Constructor Detail

LockInfoback to summary
public LockInfo(String className, int identityHashCode)

Constructs a LockInfo object.

Parameters
className:String

the fully qualified name of the class of the lock object.

identityHashCode:int

the identity hash code of the lock object.

LockInfoback to summary
pack-priv LockInfo(Object lock)

package-private constructors

Method Detail

fromback to summary
public static LockInfo from(CompositeData cd)

Returns a LockInfo object represented by the given CompositeData. The given CompositeData must contain the following attributes:

The attributes and the types the given CompositeData contains
Attribute Name Type
className java.lang.String
identityHashCode java.lang.Integer
Parameters
cd:CompositeData

CompositeData representing a LockInfo

Returns:LockInfo

a LockInfo object represented by cd if cd is not null; null otherwise.

Exceptions
IllegalArgumentException:
if cd does not represent a LockInfo with the attributes described above.
Since
1.8
getClassNameback to summary
public String getClassName()

Returns the fully qualified name of the class of the lock object.

Returns:String

the fully qualified name of the class of the lock object.

getIdentityHashCodeback to summary
public int getIdentityHashCode()

Returns the identity hash code of the lock object returned from the System#identityHashCode method.

Returns:int

the identity hash code of the lock object.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of a lock. The returned string representation consists of the name of the class of the lock object, the at-sign character `@', and the unsigned hexadecimal representation of the identity hash code of the object. This method returns a string equals to the value of:

lock.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(lock))
where lock is the lock object.
Returns:String

the string representation of a lock.