Interface ContextualFactory<T>

Type Parameters:
T - the actual object type that shall be constructed.
All Known Implementing Classes:

public interface ContextualFactory<T>
A factory depending on an InvocationContext providing specific information about the context of the object creation. This differs from typical factories by allowing implementors to make decisions based on the context of the invocation. In most cases the context of an invocation will be a ServletInvocationContext, providing access to typical jakarta.websocket objects like HttpSession.
  • Method Details

    • create

      T create(InvocationContext context)

      Factory method that injects the current InvocationContext.

      The InvocationContext is only valid within this method. Any later invocation will result in an IllegalStateException.

      context - The context to create an object for.
      The object type that shall be constructed