Interface OptionalThreadLocal<T>
- All Known Implementing Classes:
ThreadLocalImpl.OptionalThreadLocalImpl
Provides ThreadLocal access to the ManagedObject object
instances.
For applications making use of OfficeFloor functionality this is not
typically required. It is provided to enable integration with third party
libraries requiring ThreadLocal access to objects.
- Author:
- Daniel Sagenschneider
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionget()Obtains the object for the respectiveManagedObjectthis represents.
-
Method Details
-
get
T get()Obtains the object for the respective
ManagedObjectthis represents.This is optional, for if the
ManagedObjectis not yet instantiated then this will returnnull. AsManagedObjectinstances are asynchronously loaded, they can not be loaded synchronously for this method. Hence, it may returnnullif theManagedObjecthas not been required as a dependency.To ensure the
ManagedObjectis available, have theManagedFunctionorManagedObjectusing thisOptionalThreadLocaldepend on theManagedObjectthis represents.- Returns:
- Object from the
ManagedObjectornullifManagedObjectnot instantiated yet.
-