Class InjectContext

java.lang.Object
net.officefloor.servlet.inject.InjectContext

public class InjectContext extends Object
Context for injection.
Author:
Daniel Sagenschneider
  • Field Details

    • REQUEST_ATTRIBUTE_NAME

      public static final String REQUEST_ATTRIBUTE_NAME
      Name of attribute storing the InjectContext.
  • Constructor Details

    • InjectContext

      public InjectContext(SupplierThreadLocal<?>[] supplierThreadLocals)
      Instantiate.
      Parameters:
      supplierThreadLocals - Listing of SupplierThreadLocal instances with indexes corresponding to dependency index.
  • Method Details

    • getActiveDependency

      public static Object getActiveDependency(int dependencyIndex) throws IllegalStateException
      Obtains the dependency.
      Parameters:
      dependencyIndex - Index of the dependency.
      Returns:
      Dependency.
      Throws:
      IllegalStateException - If invoked from an unmanaged Thread.
    • activate

      public void activate()
      Activates this InjectContext.
    • synchroniseForAnotherThread

      public void synchroniseForAnotherThread()
      Synchronises this InjectContext for another Thread.