]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/ExecutionAspect.java
Introduce a factory bean to use execution resources
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.simple / src / main / java / org / argeo / slc / core / execution / ExecutionAspect.java
index aae2e80c60568e07626d59cedd4324d351141e18..c2abfed27005ebde3fbc4c37918005aa05f36287 100644 (file)
@@ -2,6 +2,7 @@ package org.argeo.slc.core.execution;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.execution.ExecutionContext;
 import org.argeo.slc.execution.ExecutionFlow;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.ProceedingJoinPoint;
@@ -15,13 +16,23 @@ import org.aspectj.lang.annotation.Pointcut;
 public class ExecutionAspect {
        private static Log log = LogFactory.getLog(ExecutionAspect.class);
 
+       private ExecutionContext executionContext;
+       
+       public ExecutionContext getExecutionContext() {
+               return executionContext;
+       }
+
+       public void setExecutionContext(ExecutionContext executionContext) {
+               this.executionContext = executionContext;
+       }
+
        @Before("flowExecution()")
        public void beforeFlow(JoinPoint jp) throws Throwable {
                //log.debug("this " + jp.getThis().getClass());
                //log.debug("target " + jp.getTarget().getClass());
                // Thread.dumpStack();
                ExecutionFlow executionFlow = (ExecutionFlow) jp.getTarget();
-               ExecutionContext.enterFlow(executionFlow);
+               executionContext.enterFlow(executionFlow);
        }
 
        @After("flowExecution()")
@@ -29,10 +40,12 @@ public class ExecutionAspect {
                //log.debug("this " + jp.getThis().getClass());
                //log.debug("target " + jp.getTarget().getClass());
                ExecutionFlow executionFlow = (ExecutionFlow) jp.getTarget();
-               ExecutionContext.leaveFlow(executionFlow);
+               executionContext.leaveFlow(executionFlow);
        }
 
-       @Pointcut("execution(void org.argeo.slc.execution.ExecutionFlow.execute())")
+       @Pointcut("execution(void org.argeo.slc.execution.ExecutionFlow.run())")
        public void flowExecution() {
        }
+       
+       
 }