- if (log.isDebugEnabled())
- logStackEvent("=> ", executionFlow);
- // Actually execute the flow
- pjp.proceed();
- if (log.isDebugEnabled())
- logStackEvent("<= ", executionFlow);
-
- executionStack.leaveFlow(executionFlow);
- }
-
- @Around("runnableExecution()")
- public void aroundRunnable(ProceedingJoinPoint pjp) throws Throwable {
- ExecutionFlow executionFlow = (ExecutionFlow) pjp.getTarget();
- Runnable runnable = (Runnable) pjp.getArgs()[0];
- if (log.isDebugEnabled())
- logRunnableExecution(executionFlow, runnable);
- // Actually execute the runnable
- pjp.proceed();
+ logStackEvent("=> ", executionFlow, false);
+ try {
+ // Actually execute the flow
+ pjp.proceed();
+ } finally {
+ logStackEvent("<= ", executionFlow, true);
+ executionStack.leaveFlow(executionFlow);
+ }