Package com.tangosol.util
Class ThreadLocalObject
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.ThreadLocalObject
This class provides an implementation of thread local storage.
As of Coherence 3.3 this class is a wrapper around ThreadLocal
.
Note: Where practical, use java.lang.ThreadLocal
directly.
- Author:
- cp 1997.05.03; mf 2007.04.27
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a ThreadLocalObject.ThreadLocalObject
(Object object) Create a ThreadLocalObject with an initial value. -
Method Summary
Modifier and TypeMethodDescriptionvoid
check()
Deprecated.as of Coherence 3.3 this method is a no-opget()
Get the value of the ThreadLocalObject for the current thread.Get the value of the ThreadLocalObject for the current thread.int
Deprecated.as of Coherence 3.3 this method always returns zero.int
Deprecated.as of Coherence 3.3 this method always returns zero.protected Object
getValue()
Get the value stored by this instance of ThreadLocalObject.void
prune()
Deprecated.as of Coherence 3.3 this method is a no-opvoid
remove()
Remove the ThreadLocalObject for the current thread.void
Set the value of the ThreadLocalObject for the current thread.void
Set the value of the ThreadLocalObject for the current thread.void
setPruneDelay
(int cMillisDelay) Deprecated.as of Coherence 3.3 this method is a no-opvoid
setRollover
(int cRollover) Deprecated.as of Coherence 3.3 this method is a no-opprotected void
Set the value stored by this instance of ThreadLocalObject.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
-
Constructor Details
-
ThreadLocalObject
public ThreadLocalObject()Create a ThreadLocalObject. -
ThreadLocalObject
Create a ThreadLocalObject with an initial value.- Parameters:
object
- the ThreadLocalObject value for the current thread
-
-
Method Details
-
get
Get the value of the ThreadLocalObject for the current thread.- Returns:
- the value for the current thread
- See Also:
-
set
Set the value of the ThreadLocalObject for the current thread.- Parameters:
object
- the value for the current thread- See Also:
-
remove
public void remove()Remove the ThreadLocalObject for the current thread.Note: On 1.4.x JVMs this method will not free any storage but will reset the value to the initial value.
-
getObject
Get the value of the ThreadLocalObject for the current thread.- Returns:
- the value for the current thread
- See Also:
-
setObject
Set the value of the ThreadLocalObject for the current thread.- Parameters:
object
- the value for the current thread- See Also:
-
check
public void check()Deprecated.as of Coherence 3.3 this method is a no-opCheck if pruning is necessary. -
prune
public void prune()Deprecated.as of Coherence 3.3 this method is a no-opPrune the list of dead threads. -
getRollover
public int getRollover()Deprecated.as of Coherence 3.3 this method always returns zero.Get the number of sets/removes necessary before a rollover occurs.- Returns:
- the rollover value
-
setRollover
public void setRollover(int cRollover) Deprecated.as of Coherence 3.3 this method is a no-opSet the number of sets/removes necessary before a rollover occurs.- Parameters:
cRollover
- the rollover value
-
getPruneDelay
public int getPruneDelay()Deprecated.as of Coherence 3.3 this method always returns zero.Get the minimum number of seconds between prunings.- Returns:
- the minimum number of milliseconds to delay
-
setPruneDelay
public void setPruneDelay(int cMillisDelay) Deprecated.as of Coherence 3.3 this method is a no-opSet the minimum number of seconds between prunings.- Parameters:
cMillisDelay
- the minimum number of milliseconds to delay
-
getValue
Get the value stored by this instance of ThreadLocalObject.- Returns:
- the value stored by this instance of ThreadLocalObject
-
setValue
Set the value stored by this instance of ThreadLocalObject.- Parameters:
object
- the new value
-