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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Context
getContext(Job job)
Return non null context for this job.default void
handle(Job job, java.util.concurrent.Callable<java.lang.Void> next)
Middleware handles that would be called
-
-
-
Method Detail
-
getContext
Context getContext(Job job)
Return non null context for this job. This method can also update MDCMDC
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 interfaceMiddleware
- Parameters:
job
- job objectnext
- next middleware in chain- Throws:
java.lang.Exception
- any exception
-
-