]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/MapExecutionContext.java
Add generate script
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / MapExecutionContext.java
1 package org.argeo.slc.core.execution;
2
3 import java.util.Collections;
4 import java.util.Date;
5 import java.util.HashMap;
6 import java.util.Map;
7 import java.util.UUID;
8
9 import org.argeo.slc.execution.ExecutionContext;
10
11 public class MapExecutionContext implements
12 ExecutionContext {
13 private final Map<String, Object> variables = Collections
14 .synchronizedMap(new HashMap<String, Object>());
15
16 private final String uuid;
17
18 public MapExecutionContext() {
19 uuid = UUID.randomUUID().toString();
20 variables.put(VAR_EXECUTION_CONTEXT_ID, uuid);
21 variables.put(VAR_EXECUTION_CONTEXT_CREATION_DATE, new Date());
22 }
23
24 public void setVariable(String key, Object value) {
25 variables.put(key, value);
26 }
27
28 public Object getVariable(String key) {
29 return variables.get(key);
30 }
31
32 public String getUuid() {
33 return uuid;
34 }
35 }