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