]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/ExecutionTargetSource.java
Create basic test module of the SLC demo
[gpl/argeo-slc.git] / runtime / org.argeo.slc.execution / src / main / java / org / argeo / slc / execution / ExecutionTargetSource.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.springframework.aop.TargetSource;
6
7 public class ExecutionTargetSource implements TargetSource {
8 private final static Log log = LogFactory
9 .getLog(ExecutionTargetSource.class);
10
11 private final String name;
12 private final Class<?> targetClass;
13 private final ExecutionFlow executionFlow;
14
15 public ExecutionTargetSource(ExecutionFlow executionFlow,
16 Class<?> targetClass, String name) {
17 this.executionFlow = executionFlow;
18 this.targetClass = targetClass;
19 this.name = name;
20 }
21
22 public Object getTarget() throws Exception {
23 if (log.isTraceEnabled())
24 log.trace("Getting object " + name);
25 Object obj = executionFlow.getParameter(name);
26 if (log.isTraceEnabled())
27 log.trace("Target object " + obj);
28 return obj;
29 }
30
31 public Class getTargetClass() {
32 return targetClass;
33 }
34
35 public boolean isStatic() {
36 return false;
37 }
38
39 public void releaseTarget(Object target) throws Exception {
40 // TODO Auto-generated method stub
41
42 }
43
44 }