1 package org
.argeo
.slc
.executionflow
;
5 import org
.apache
.commons
.logging
.Log
;
6 import org
.apache
.commons
.logging
.LogFactory
;
7 import org
.argeo
.slc
.SlcException
;
8 import org
.springframework
.aop
.TargetSource
;
10 public class ExecutionTargetSource
implements TargetSource
{
11 private final static Log log
= LogFactory
12 .getLog(ExecutionTargetSource
.class);
14 private final String name
;
15 private final Class
<?
> targetClass
;
16 private final ExecutionFlow executionFlow
;
18 public ExecutionTargetSource(ExecutionFlow executionFlow
,
19 Class
<?
> targetClass
, String name
) {
20 this.executionFlow
= executionFlow
;
21 this.targetClass
= targetClass
;
25 public Object
getTarget() throws Exception
{
26 if (log
.isTraceEnabled())
27 log
.trace("Getting object " + name
);
28 Map
<String
, Object
> attributes
= executionFlow
.getAttributes();
29 if (!attributes
.containsKey(name
))
30 throw new SlcException("Key " + name
+ " is not registered in "
32 Object obj
= attributes
.get(name
);
33 if (log
.isTraceEnabled())
34 log
.trace("Target object " + obj
);
38 public Class
getTargetClass() {
42 public boolean isStatic() {
46 public void releaseTarget(Object target
) throws Exception
{
47 // TODO Auto-generated method stub