Class ThreadLocalImpl.OptionalThreadLocalImpl<T>
- java.lang.Object
-
- net.officefloor.frame.impl.execute.thread.ThreadLocalImpl.OptionalThreadLocalImpl<T>
-
- All Implemented Interfaces:
OptionalThreadLocal<T>
- Enclosing class:
- ThreadLocalImpl<T>
public static class ThreadLocalImpl.OptionalThreadLocalImpl<T> extends java.lang.Object implements OptionalThreadLocal<T>
OptionalThreadLocal
implementation.
-
-
Constructor Summary
Constructors Constructor Description OptionalThreadLocalImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
Obtains the object for the respectiveManagedObject
this represents.
-
-
-
Method Detail
-
get
public T get()
Description copied from interface:OptionalThreadLocal
Obtains the object for the respective
ManagedObject
this represents.This is optional, for if the
ManagedObject
is not yet instantiated then this will returnnull
. AsManagedObject
instances are asynchronously loaded, they can not be loaded synchronously for this method. Hence, it may returnnull
if theManagedObject
has not been required as a dependency.To ensure the
ManagedObject
is available, have theManagedFunction
orManagedObject
using thisOptionalThreadLocal
depend on theManagedObject
this represents.- Specified by:
get
in interfaceOptionalThreadLocal<T>
- Returns:
- Object from the
ManagedObject
ornull
ifManagedObject
not instantiated yet.
-
-