01: package org.objectweb.celtix.configuration.impl;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: import org.objectweb.celtix.configuration.Configuration;
07: import org.objectweb.celtix.configuration.ConfigurationProvider;
08:
09: /**
10: * Temporay class to accept changes to configuration. Should be obsoleted once other providers
11: * have implemented the setObject.
12: */
13: public class InMemoryProvider implements ConfigurationProvider {
14:
15: private Map<String, Object> map;
16:
17: public InMemoryProvider() {
18: map = new HashMap<String, Object>();
19: }
20:
21: public void init(Configuration configuration) {
22: }
23:
24: public Object getObject(String name) {
25: return map.get(name);
26: }
27:
28: public boolean setObject(String name, Object value) {
29: map.put(name, value);
30: return true;
31: }
32:
33: public boolean save() {
34: return false;
35: }
36: }
|