]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/ExecutionAspect.java
Change the generated XML for the execution message
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.simple / src / main / java / org / argeo / slc / core / execution / ExecutionAspect.java
1 package org.argeo.slc.core.execution;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5 import org.argeo.slc.execution.ExecutionFlow;
6 import org.aspectj.lang.JoinPoint;
7 import org.aspectj.lang.ProceedingJoinPoint;
8 import org.aspectj.lang.annotation.After;
9 import org.aspectj.lang.annotation.Around;
10 import org.aspectj.lang.annotation.Aspect;
11 import org.aspectj.lang.annotation.Before;
12 import org.aspectj.lang.annotation.Pointcut;
13
14 @Aspect
15 public class ExecutionAspect {
16 private static Log log = LogFactory.getLog(ExecutionAspect.class);
17
18 @Before("flowExecution()")
19 public void beforeFlow(JoinPoint jp) throws Throwable {
20 //log.debug("this " + jp.getThis().getClass());
21 //log.debug("target " + jp.getTarget().getClass());
22 // Thread.dumpStack();
23 ExecutionFlow executionFlow = (ExecutionFlow) jp.getTarget();
24 ExecutionContext.enterFlow(executionFlow);
25 }
26
27 @After("flowExecution()")
28 public void afterFlow(JoinPoint jp) throws Throwable {
29 //log.debug("this " + jp.getThis().getClass());
30 //log.debug("target " + jp.getTarget().getClass());
31 ExecutionFlow executionFlow = (ExecutionFlow) jp.getTarget();
32 ExecutionContext.leaveFlow(executionFlow);
33 }
34
35 @Pointcut("execution(void org.argeo.slc.execution.ExecutionFlow.execute())")
36 public void flowExecution() {
37 }
38 }