comparison artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactContext.java @ 5:8f2de197bce2

Added config to artifact database and modelled bootstap of artifact factories on top of this. artifacts/trunk@15 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 04 Sep 2009 12:04:12 +0000
parents
children 48d1a9a082c2
comparison
equal deleted inserted replaced
4:13a12b607baf 5:8f2de197bce2
1 package de.intevation.artifactdatabase;
2
3 import java.util.HashMap;
4
5 import org.w3c.dom.Document;
6
7 /**
8 * Default implementation of the context.
9 * Besides of the configuration it hosts a map to store key/value pairs.
10 *
11 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
12 */
13 public class DefaultArtifactContext
14 {
15 protected Document config;
16
17 protected HashMap map;
18
19 public DefaultArtifactContext() {
20 this(null);
21 }
22
23 public DefaultArtifactContext(Document config) {
24 this.config = config;
25 map = new HashMap();
26 }
27
28 public synchronized Object get(Object key) {
29 return map.get(key);
30 }
31
32 public synchronized Object put(Object key, Object value) {
33 return map.put(key, value);
34 }
35
36 public Document getConfig() {
37 return config;
38 }
39 }
40 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org