Interface ContextMiddleware

  • All Superinterfaces:
    Middleware

    public interface ContextMiddleware
    extends Middleware
    Context middleware allows us to set context for the running job, context could be any thing like putting user information for permission check, initiating some transaction.

    Job's context can be updated from any where/middleware, this middleware is just for consolidation action.

    See Also:
    DefaultContext
    • Method Detail

      • getContext

        Context getContext​(Job job)
        Return non null context for this job. This method can also update MDC MDC context or any other context .
        Parameters:
        job - job object
        Returns:
        a new context
      • handle

        default void handle​(Job job,
                            java.util.concurrent.Callable<java.lang.Void> next)
                     throws java.lang.Exception
        Description copied from interface: Middleware
        Middleware handles that would be called
        Specified by:
        handle in interface Middleware
        Parameters:
        job - job object
        next - next middleware in chain
        Throws:
        java.lang.Exception - any exception