Class J7mContext

java.lang.Object
org.j7m.middleware.application.api.J7mContext

public final class J7mContext extends Object
Accessor for the current application invocation context.

The implementation uses a private ThreadLocal. Runtime and deployer code must use the returned J7mContext.Scope with try-with-resources so context is cleared after dispatch. Access outside a managed invocation returns an empty safe context.

  • Method Details

    • currentInvocation

      public static InvocationContext currentInvocation()
      Returns the current invocation context or an empty safe context.
      Returns:
      current context
    • open

      public static J7mContext.Scope open(InvocationContext context)
      Installs a context until the returned scope is closed.
      Parameters:
      context - context to install
      Returns:
      closeable scope