Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactContext.java @ 83:8c4638abd518
Installed a SLF4J bridge to route incoming jul logs (used by restlet) to log4j.
artifacts/trunk@820 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 22 Mar 2010 15:54:06 +0000 |
parents | 48d1a9a082c2 |
children | 68285f7bc476 |
rev | line source |
---|---|
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.artifactdatabase; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.util.HashMap; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import org.w3c.dom.Document; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 /** |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 * Default implementation of the context. |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 * Besides of the configuration it hosts a map to store key/value pairs. |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 * |
77
48d1a9a082c2
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5
diff
changeset
|
11 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 */ |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 public class DefaultArtifactContext |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 protected Document config; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 protected HashMap map; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 public DefaultArtifactContext() { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 this(null); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 public DefaultArtifactContext(Document config) { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 this.config = config; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 map = new HashMap(); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 public synchronized Object get(Object key) { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 return map.get(key); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 public synchronized Object put(Object key, Object value) { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 return map.put(key, value); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 public Document getConfig() { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 return config; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: |