comparison artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java @ 58:39fec7d714dc

Added a real artifact proxy class to be more flexible with artifact replacements in artifact databases. artifacts/trunk@359 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 23 Nov 2009 11:15:44 +0000
parents 9a29899b31e5
children 89e3de0ee05f
comparison
equal deleted inserted replaced
57:cf9848c85755 58:39fec7d714dc
52 implements CallContext 52 implements CallContext
53 { 53 {
54 protected PersistentArtifact artifact; 54 protected PersistentArtifact artifact;
55 protected int action; 55 protected int action;
56 protected CallMeta callMeta; 56 protected CallMeta callMeta;
57 protected HashMap customValues;
57 58
58 public CallContextImpl( 59 public CallContextImpl(
59 PersistentArtifact artifact, 60 PersistentArtifact artifact,
60 int action, 61 int action,
61 CallMeta callMeta 62 CallMeta callMeta
104 default: 105 default:
105 logger.error(INVALID_CALL_STATE + ": " + action); 106 logger.error(INVALID_CALL_STATE + ": " + action);
106 throw new IllegalStateException(INVALID_CALL_STATE); 107 throw new IllegalStateException(INVALID_CALL_STATE);
107 } 108 }
108 } 109 }
110
111 public Object getContextValue(Object key) {
112 return customValues != null
113 ? customValues.get(key)
114 : null;
115 }
116
117 public Object putContextValue(Object key, Object value) {
118 if (customValues == null) {
119 customValues = new HashMap();
120 }
121 return customValues.put(key, value);
122 }
109 } // class CallContextImpl 123 } // class CallContextImpl
110 124
111 public class DeferredOutputImpl 125 public class DeferredOutputImpl
112 implements DeferredOutput 126 implements DeferredOutput
113 { 127 {

http://dive4elements.wald.intevation.org