Interface Contexts<T extends jakarta.enterprise.context.spi.Context>

Type Parameters:
T - The concrete context type of the implementation

public interface Contexts<T extends jakarta.enterprise.context.spi.Context>
This interface provides operations relating to Contexts. The TCK porting package must provide an implementation of this interface which is suitable for the target implementation.
Author:
Shane Bryzak, Pete Muir
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    destroyContext(T context)
    Destroy the context.
    Returns the dependent context, regardless of whether it is active or not
    Get the request context, regardless of whether it is active or not
    void
    setActive(T context)
    Sets the specified context as active.
    void
    setInactive(T context)
    Sets the specified context as inactive.
  • Field Details

    • PROPERTY_NAME

      static final String PROPERTY_NAME
  • Method Details

    • setActive

      void setActive(T context)
      Sets the specified context as active.

      The set of existing contextual instances of the context is preserved across invocations of setActive(Context) and setInactive(Context).

      Parameters:
      context - The context to set active
    • setInactive

      void setInactive(T context)
      Sets the specified context as inactive.

      The set of existing contextual instances of the context is preserved across invocations of setActive(Context) and setInactive(Context).

      Parameters:
      context - The context to set inactive
    • getRequestContext

      T getRequestContext()
      Get the request context, regardless of whether it is active or not
      Returns:
      The request context
    • getDependentContext

      T getDependentContext()
      Returns the dependent context, regardless of whether it is active or not
      Returns:
      the dependent context
    • destroyContext

      void destroyContext(T context)
      Destroy the context. This operation is defined by the CDI specification but has no API.
      Parameters:
      context - the context to destroy