Interface OptionalThreadLocal<T>
-
- All Known Implementing Classes:
ThreadLocalImpl.OptionalThreadLocalImpl
public interface OptionalThreadLocal<T>
Provides
ThreadLocal
access to theManagedObject
object instances.For applications making use of
OfficeFloor
functionality this is not typically required. It is provided to enable integration with third party libraries requiringThreadLocal
access to objects.- Author:
- Daniel Sagenschneider
- See Also:
ThreadDependencyMappingBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
get()
Obtains the object for the respectiveManagedObject
this represents.
-
-
-
Method Detail
-
get
T get()
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.- Returns:
- Object from the
ManagedObject
ornull
ifManagedObject
not instantiated yet.
-
-