1 package org
.argeo
.slc
.executionflow
;
3 import org
.apache
.commons
.logging
.Log
;
4 import org
.apache
.commons
.logging
.LogFactory
;
5 import org
.aspectj
.lang
.JoinPoint
;
6 import org
.aspectj
.lang
.ProceedingJoinPoint
;
7 import org
.aspectj
.lang
.annotation
.After
;
8 import org
.aspectj
.lang
.annotation
.Around
;
9 import org
.aspectj
.lang
.annotation
.Aspect
;
10 import org
.aspectj
.lang
.annotation
.Before
;
11 import org
.aspectj
.lang
.annotation
.Pointcut
;
14 public class ExecutionAspect
{
15 private static Log log
= LogFactory
.getLog(ExecutionAspect
.class);
17 // @Around("execution(void org.argeo.slc.executionflow.ExecutionFlow.execute()) && target(org.argeo.slc.executionflow.ExecutionFlow)")
18 public void registerFlow(ProceedingJoinPoint pjp
) throws Throwable
{
20 log
.debug("registerFlow " + pjp
.getTarget().getClass());
21 ExecutionContext
.enterFlow((ExecutionFlow
) pjp
.getTarget());
24 ExecutionContext
.leaveFlow((ExecutionFlow
) pjp
.getTarget());
28 @Before("flowExecution()")
29 public void beforeFlow(JoinPoint jp
) throws Throwable
{
30 //log.debug("this " + jp.getThis().getClass());
31 //log.debug("target " + jp.getTarget().getClass());
32 // Thread.dumpStack();
33 ExecutionFlow executionFlow
= (ExecutionFlow
) jp
.getTarget();
34 ExecutionContext
.enterFlow(executionFlow
);
37 @After("flowExecution()")
38 public void afterFlow(JoinPoint jp
) throws Throwable
{
39 //log.debug("this " + jp.getThis().getClass());
40 //log.debug("target " + jp.getTarget().getClass());
41 ExecutionFlow executionFlow
= (ExecutionFlow
) jp
.getTarget();
42 ExecutionContext
.leaveFlow(executionFlow
);
45 @Pointcut("execution(void org.argeo.slc.executionflow.ExecutionFlow.execute())")
46 public void flowExecution() {