Class WrapperConcurrentMap.Lock
- java.lang.Object
-
- com.tangosol.util.Base
-
- com.tangosol.util.WrapperConcurrentMap.Lock
-
- Enclosing class:
- WrapperConcurrentMap<K,V>
protected static class WrapperConcurrentMap.Lock extends Base
A lock object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Lock()
Construct a new Lock object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
assign(long cWait)
Assign the ownership of this Lock to the calling thread.protected int
getBlockCount()
Return the blocked threads count.protected int
getLockCount()
Return the lock count.protected Thread
getLockThread()
Return the Thread object holding this Lock.protected String
getLockTypeDescription()
Return a human readable description of the Lock type.protected boolean
isDirty()
Checks whether or not this Lock object is held by another thread.protected boolean
isDiscardable()
Checks whether or not this Lock object is discardable.protected boolean
isOwnedByCaller()
Checks whether or not this Lock object is held by the calling thread.protected boolean
release()
Release this Lock.String
toString()
Return a human readable description of the Lock.protected long
waitForNotify(long cWait)
Wait for a Lock release notification.-
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
-
-
-
-
Method Detail
-
assign
protected boolean assign(long cWait)
Assign the ownership of this Lock to the calling thread.Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.
- Parameters:
cWait
- the number of milliseconds to continue trying to obtain a lock; pass zero to return immediately; pass -1 to block the calling thread until the lock could be obtained- Returns:
- true if lock was successful; false otherwise
-
waitForNotify
protected long waitForNotify(long cWait)
Wait for a Lock release notification.Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.
- Parameters:
cWait
- the number of milliseconds to continue waiting; pass -1 to block the calling thread indefinitely- Returns:
- updated wait time.
-
release
protected boolean release()
Release this Lock.Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.
- Returns:
- true if unlock is successful; false if the entry remained locked
-
isDirty
protected boolean isDirty()
Checks whether or not this Lock object is held by another thread.Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.
- Returns:
- true if the Lock is held by another thread; false otherwise
-
isOwnedByCaller
protected boolean isOwnedByCaller()
Checks whether or not this Lock object is held by the calling thread.Note: unlike other methods of this class, the caller of this method is not required to hold a synchronization monitor for the Lock object while making this call.
- Returns:
- true if the Lock is held by the calling thread; false otherwise
-
isDiscardable
protected boolean isDiscardable()
Checks whether or not this Lock object is discardable.Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.
- Returns:
- true if the Lock is discardable; false otherwise
-
getLockThread
protected Thread getLockThread()
Return the Thread object holding this Lock.- Returns:
- the Thread object holding this Lock.
-
getLockCount
protected int getLockCount()
Return the lock count.- Returns:
- the lock count
-
getBlockCount
protected int getBlockCount()
Return the blocked threads count.- Returns:
- the blocked threads count
-
getLockTypeDescription
protected String getLockTypeDescription()
Return a human readable description of the Lock type.- Returns:
- a human readable description of the Lock type
-
-