Package net.officefloor.servlet.inject
Class InjectContext
java.lang.Object
net.officefloor.servlet.inject.InjectContext
Context for injection.
- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of attribute storing theInjectContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates thisInjectContext.static ObjectgetActiveDependency(int dependencyIndex) Obtains the dependency.voidSynchronises thisInjectContextfor anotherThread.
-
Field Details
-
REQUEST_ATTRIBUTE_NAME
Name of attribute storing theInjectContext.
-
-
Constructor Details
-
InjectContext
Instantiate.- Parameters:
supplierThreadLocals- Listing ofSupplierThreadLocalinstances with indexes corresponding to dependency index.
-
-
Method Details
-
getActiveDependency
Obtains the dependency.- Parameters:
dependencyIndex- Index of the dependency.- Returns:
- Dependency.
- Throws:
IllegalStateException- If invoked from an unmanagedThread.
-
activate
public void activate()Activates thisInjectContext. -
synchroniseForAnotherThread
public void synchroniseForAnotherThread()Synchronises thisInjectContextfor anotherThread.
-