class ThreadGlobal[T] extends AnyRef
This is a decorator for a ThreadLocal variable that provides convenience methods to transform the variable to a Box and execute functions in a "scope" wherein the variable may hold a different value.
- Alphabetic
- By Inheritance
- ThreadGlobal
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ThreadGlobal()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(v: T): ThreadGlobal[T]
Alias for
set(v: T)Alias for
set(v: T)- v
the value to set.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def box: Box[T]
Returns a Box containing the value of this ThreadGlobal in a null-safe fashion.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def doWith[R](x: T)(f: => R): R
Sets this ThreadGlobal's contents to the specified value, executes the specified function, and then restores the ThreadGlobal to its earlier value.
Sets this ThreadGlobal's contents to the specified value, executes the specified function, and then restores the ThreadGlobal to its earlier value. This effectively creates a scope within the execution of the current thread for the execution of the specified function.
- x
the value to temporarily set in this ThreadGlobal
- f
the function to execute
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def set(v: T): ThreadGlobal[T]
Sets the value of this ThreadGlobal.
Sets the value of this ThreadGlobal.
- v
the value to set.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def value: T
Returns the current value of this variable.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()