package org.argeo.slc.executionflow; import java.util.HashMap; import java.util.Map; import org.springframework.aop.framework.ProxyFactory; public class SimpleExecutionSpec implements ExecutionSpec { private Map attributes = new HashMap(); public Map getAttributes() { return attributes; } public void setAttributes(Map attributes) { this.attributes = attributes; } public Object createRef(String name) { RefSpecAttribute refSpecAttribute = (RefSpecAttribute) attributes .get(name); Class targetClass = refSpecAttribute.getTargetClass(); ExecutionTargetSource targetSource = new ExecutionTargetSource(); targetSource.setName(name); targetSource.setTargetClass(targetClass); ProxyFactory proxyFactory = new ProxyFactory(); proxyFactory.setTargetClass(targetClass); proxyFactory.setProxyTargetClass(true); proxyFactory.setTargetSource(targetSource); return proxyFactory.getProxy(); } }