]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/ExecutionScope.java
ActiveMQ and Castor integration
[gpl/argeo-slc.git] / runtime / org.argeo.slc.execution / src / main / java / org / argeo / slc / execution / ExecutionScope.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.argeo.slc.SlcException;
6 import org.springframework.beans.factory.ObjectFactory;
7 import org.springframework.beans.factory.config.Scope;
8
9 public class ExecutionScope implements Scope {
10 private final static Log log = LogFactory.getLog(ExecutionScope.class);
11
12 public Object get(String name, ObjectFactory objectFactory) {
13
14 if (log.isTraceEnabled())
15 log.trace("Getting scoped bean " + name);
16 return ExecutionContext.findOrAddScopedObject(name, objectFactory);
17
18 // if (ExecutionContext.getScopedObjects().containsKey(name)) {
19 // // returns cached instance
20 // Object obj = ExecutionContext.getScopedObjects().get(name);
21 // if (log.isTraceEnabled())
22 // log.trace("Return cached scoped object " + obj);
23 // return obj;
24 // } else {
25 // // creates instance
26 // Object obj = objectFactory.getObject();
27 // ExecutionContext.getScopedObjects().put(name, obj);
28 // if (log.isTraceEnabled())
29 // log.trace("Created regular scoped object " + obj);
30 // return obj;
31 // }
32 }
33
34 public String getConversationId() {
35 return ExecutionContext.getCurrentStackUuid();
36 }
37
38 public void registerDestructionCallback(String name, Runnable callback) {
39 // TODO: implement it
40 //throw new UnsupportedOperationException();
41 }
42
43 public Object remove(String name) {
44 log.debug("Remove object " + name);
45 throw new UnsupportedOperationException();
46 }
47
48 }