public class TaskInterceptorChain extends Object implements TaskInterceptor
Usage: method1:
Callable task0 = new Callable(){run(){...}};
WrappedCallable task00 = new WrappedCallable(task0);
executor.submit(task00);
Runnable task1 = new Runnable(){run(){...}};
WrappedRunnable task11 = new WrappedRunnable(task1);
executor.submit(task11);
method2:
using WrappedThread
method3:
using CommonThreadFactory
public void addInterceptor(TaskInterceptor interceptor)
public void doBefore()
doBefore 在接口中 TaskInterceptorpublic void doAfter()
doAfter 在接口中 TaskInterceptorpublic void doError(Throwable ex)
doError 在接口中 TaskInterceptorCopyright © 2019. All rights reserved.