Interface ContextualFactory<T>

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

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.

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