]> git.argeo.org Git - gpl/argeo-slc.git/blob - sandbox/argeo.slc.executionflow/src/main/java/org/argeo/slc/execution/ExecutionAspect.java
Change package name
[gpl/argeo-slc.git] / sandbox / argeo.slc.executionflow / src / main / java / org / argeo / slc / execution / ExecutionAspect.java
1 package org.argeo.slc.execution;
2
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;
12
13 @Aspect
14 public class ExecutionAspect {
15 private static Log log = LogFactory.getLog(ExecutionAspect.class);
16
17 @Before("flowExecution()")
18 public void beforeFlow(JoinPoint jp) throws Throwable {
19 //log.debug("this " + jp.getThis().getClass());
20 //log.debug("target " + jp.getTarget().getClass());
21 // Thread.dumpStack();
22 ExecutionFlow executionFlow = (ExecutionFlow) jp.getTarget();
23 ExecutionContext.enterFlow(executionFlow);
24 }
25
26 @After("flowExecution()")
27 public void afterFlow(JoinPoint jp) throws Throwable {
28 //log.debug("this " + jp.getThis().getClass());
29 //log.debug("target " + jp.getTarget().getClass());
30 ExecutionFlow executionFlow = (ExecutionFlow) jp.getTarget();
31 ExecutionContext.leaveFlow(executionFlow);
32 }
33
34 @Pointcut("execution(void org.argeo.slc.execution.ExecutionFlow.execute())")
35 public void flowExecution() {
36 }
37 }