net.sourceforge.jabm.spring
Class SimulationScope
java.lang.Object
net.sourceforge.jabm.spring.SimulationScope
- All Implemented Interfaces:
- org.springframework.beans.factory.config.Scope
public class SimulationScope
- extends java.lang.Object
- implements org.springframework.beans.factory.config.Scope
A custom Spring bean scope used to manage objects which persist
throughout a single simulation, but are re-instantiated on each new
independent simulation run.
-
-
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
boundObjects
protected java.util.HashMap<java.lang.String,java.lang.Object> boundObjects
- A mapping from bean names to objects that are bound in this scope.
simulationId
protected int simulationId
singletonInstance
protected static SimulationScope singletonInstance
ATTRIBUTE_VALUE
public static final java.lang.String ATTRIBUTE_VALUE
- The string that appears in the scope attribute of a bean definition.
- See Also:
- Constant Field Values
SimulationScope
public SimulationScope()
get
public java.lang.Object get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory)
- Specified by:
get
in interface org.springframework.beans.factory.config.Scope
remove
public java.lang.Object remove(java.lang.String name)
- Specified by:
remove
in interface org.springframework.beans.factory.config.Scope
registerDestructionCallback
public void registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
- Specified by:
registerDestructionCallback
in interface org.springframework.beans.factory.config.Scope
resolveContextualObject
public java.lang.Object resolveContextualObject(java.lang.String key)
- Specified by:
resolveContextualObject
in interface org.springframework.beans.factory.config.Scope
getConversationId
public java.lang.String getConversationId()
- Specified by:
getConversationId
in interface org.springframework.beans.factory.config.Scope
startNewSimulation
public void startNewSimulation()
- Invoked to indicate that a new simulation has begun and that a fresh
scope is required.
getSingletonInstance
public static SimulationScope getSingletonInstance()