1 package org
.argeo
.slc
.core
.execution
;
3 import org
.apache
.commons
.logging
.Log
;
4 import org
.apache
.commons
.logging
.LogFactory
;
5 import org
.argeo
.slc
.execution
.ExecutionContext
;
6 import org
.argeo
.slc
.execution
.ExecutionFlow
;
7 import org
.aspectj
.lang
.JoinPoint
;
8 import org
.aspectj
.lang
.ProceedingJoinPoint
;
9 import org
.aspectj
.lang
.annotation
.After
;
10 import org
.aspectj
.lang
.annotation
.Around
;
11 import org
.aspectj
.lang
.annotation
.Aspect
;
12 import org
.aspectj
.lang
.annotation
.Before
;
13 import org
.aspectj
.lang
.annotation
.Pointcut
;
16 public class ExecutionAspect
{
17 private static Log log
= LogFactory
.getLog(ExecutionAspect
.class);
19 private ExecutionContext executionContext
;
21 public ExecutionContext
getExecutionContext() {
22 return executionContext
;
25 public void setExecutionContext(ExecutionContext executionContext
) {
26 this.executionContext
= executionContext
;
29 @Before("flowExecution()")
30 public void beforeFlow(JoinPoint jp
) throws Throwable
{
31 //log.debug("this " + jp.getThis().getClass());
32 //log.debug("target " + jp.getTarget().getClass());
33 // Thread.dumpStack();
34 ExecutionFlow executionFlow
= (ExecutionFlow
) jp
.getTarget();
35 executionContext
.enterFlow(executionFlow
);
38 @After("flowExecution()")
39 public void afterFlow(JoinPoint jp
) throws Throwable
{
40 //log.debug("this " + jp.getThis().getClass());
41 //log.debug("target " + jp.getTarget().getClass());
42 ExecutionFlow executionFlow
= (ExecutionFlow
) jp
.getTarget();
43 executionContext
.leaveFlow(executionFlow
);
46 @Pointcut("execution(void org.argeo.slc.execution.ExecutionFlow.run())")
47 public void flowExecution() {