Interface FiberContextSwitchInterceptor


public interface FiberContextSwitchInterceptor
Interception for Fiber context switch.

Even though pipeline runs asynchronously, sometimes it's desirable to bind some state to the current thread running a fiber. Such state may include security subject (in terms of AccessController.doPrivileged(java.security.PrivilegedAction<T>)), or a transaction.

This mechanism makes it possible to do such things, by allowing some code to be executed before and after a thread executes a fiber.

The design also encapsulates the entire fiber execution in a single opaque method invocation FiberContextSwitchInterceptor.Work.execute(P), allowing the use of finally block.

Author:
Kohsuke Kawaguchi
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Abstraction of the execution that happens inside the interceptor.
  • Method Summary

    Modifier and Type
    Method
    Description
    <R, P> R
    Allows the interception of the fiber execution.