com.ibm.wsspi.threading

Interface ExecutorServiceTaskInterceptor



  • public interface ExecutorServiceTaskInterceptor
    Provides a mechanism to implement generic preinvoke and postinvoke logic for all tasks submitted to the Liberty default executor. When a task is submitted to the Liberty default executor for execution, the task will be offered to the wrap method of an ExecutorServiceTaskInterceptor in the service registry. The task returned by the wrap method will replace the original task. If there are additional implementations of ExecutorServiceTaskInterceptor in the service registry, this process will continue iteratively, with the task returned by the first ExecutorServiceTaskInterceptor being passed to the next ExecutorServiceTaskInterceptor until all registered ExecutorServiceTaskInterceptor implementations are given a chance to wrap the task. The task returned by the final interceptor will be submitted for execution. In the case of multiple implementations of ExecutorServiceTaskInterceptor, the order in which their wrap methods are invoked is undefined. Note that use of this interface should generally be avoided. The primary use case is for embeddeders who have a specific need to get control before and after every single task executed by the application server. This is not a common need, and so careful consideration should be given before registering an implementation.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> c) 
      java.lang.Runnable wrap(java.lang.Runnable r) 
    • Method Detail

      • wrap

        java.lang.Runnable wrap(java.lang.Runnable r)
      • wrap

        <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> c)