1 package org
.argeo
.slc
.execution
;
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
;
9 public class ExecutionScope
implements Scope
{
10 private final static Log log
= LogFactory
.getLog(ExecutionScope
.class);
12 public Object
get(String name
, ObjectFactory objectFactory
) {
14 if (log
.isTraceEnabled())
15 log
.trace("Getting scoped bean " + name
);
16 return ExecutionContext
.findOrAddScopedObject(name
, objectFactory
);
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);
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);
34 public String
getConversationId() {
35 return ExecutionContext
.getCurrentStackUuid();
38 public void registerDestructionCallback(String name
, Runnable callback
) {
40 //throw new UnsupportedOperationException();
43 public Object
remove(String name
) {
44 log
.debug("Remove object " + name
);
45 throw new UnsupportedOperationException();