01: package org.objectweb.celtix.context;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: import javax.xml.ws.handler.MessageContext;
07:
08: public class GenericMessageContext extends HashMap<String, Object>
09: implements MessageContext {
10: private static final long serialVersionUID = 1L;
11:
12: protected Map<String, Scope> scopes = new HashMap<String, Scope>();
13:
14: public void setScope(String arg0, Scope arg1) {
15: if (!this .containsKey(arg0)) {
16: throw new IllegalArgumentException("non-existant property-"
17: + arg0 + "is specified");
18: }
19: scopes.put(arg0, arg1);
20: }
21:
22: public Scope getScope(String arg0) {
23:
24: if (containsKey(arg0)) {
25: if (scopes.containsKey(arg0)) {
26: return scopes.get(arg0);
27: } else {
28: return Scope.HANDLER;
29: }
30: }
31: throw new IllegalArgumentException("non-existant property-"
32: + arg0 + "is specified");
33: }
34:
35: }
|