Package cn.sliew.milky.common.concurrent
Interface CallableWrapper<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Tcall()TdoCall()This method has the same semantics asRunnable.run()default voidonAfter(T result)This method is called after execution.default voidonBefore()This method is called before all execution for init.voidonFailure(Exception e)This method is invoked for all exception thrown bydoCall()default voidonFinal()This method is called in a finally block after successful execution or on a rejection.
-
-
-
Method Detail
-
doCall
T doCall() throws Exception
This method has the same semantics asRunnable.run()- Throws:
InterruptedException- if the run method throws an InterruptedExceptionException
-
onBefore
default void onBefore() throws ExceptionThis method is called before all execution for init.- Throws:
Exception
-
onAfter
default void onAfter(T result) throws Exception
This method is called after execution.- Throws:
Exception
-
onFinal
default void onFinal()
This method is called in a finally block after successful execution or on a rejection.
-
-