public class SimulationScope extends 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.
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_VALUE
The string that appears in the scope attribute of a bean definition.
|
protected HashMap<String,Object> |
boundObjects
A mapping from bean names to objects that are bound in this scope.
|
protected int |
simulationId |
protected static SimulationScope |
singletonInstance |
Constructor and Description |
---|
SimulationScope() |
Modifier and Type | Method and Description |
---|---|
Object |
get(String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory) |
String |
getConversationId() |
static SimulationScope |
getSingletonInstance() |
void |
registerDestructionCallback(String name,
Runnable callback) |
Object |
remove(String name) |
Object |
resolveContextualObject(String key) |
void |
startNewSimulation()
Invoked to indicate that a new simulation has begun and that a fresh
scope is required.
|
protected HashMap<String,Object> boundObjects
protected int simulationId
protected static SimulationScope singletonInstance
public static final String ATTRIBUTE_VALUE
public Object get(String name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)
get
in interface org.springframework.beans.factory.config.Scope
public Object remove(String name)
remove
in interface org.springframework.beans.factory.config.Scope
public void registerDestructionCallback(String name, Runnable callback)
registerDestructionCallback
in interface org.springframework.beans.factory.config.Scope
public Object resolveContextualObject(String key)
resolveContextualObject
in interface org.springframework.beans.factory.config.Scope
public String getConversationId()
getConversationId
in interface org.springframework.beans.factory.config.Scope
public void startNewSimulation()
public static SimulationScope getSingletonInstance()
Copyright © 2014. All rights reserved.