KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > context > GenericMessageContext


1 package org.objectweb.celtix.context;
2
3 import java.util.HashMap JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import javax.xml.ws.handler.MessageContext;
7
8 public class GenericMessageContext extends HashMap JavaDoc<String JavaDoc, Object JavaDoc> implements MessageContext {
9     private static final long serialVersionUID = 1L;
10     
11     protected Map JavaDoc<String JavaDoc, Scope> scopes = new HashMap JavaDoc<String JavaDoc, Scope>();
12
13     public void setScope(String JavaDoc arg0, Scope arg1) {
14         if (!this.containsKey(arg0)) {
15             throw new IllegalArgumentException JavaDoc("non-existant property-" + arg0 + "is specified");
16         }
17         scopes.put(arg0, arg1);
18     }
19
20     public Scope getScope(String JavaDoc arg0) {
21         
22         if (containsKey(arg0)) {
23             if (scopes.containsKey(arg0)) {
24                 return scopes.get(arg0);
25             } else {
26                 return Scope.HANDLER;
27             }
28         }
29         throw new IllegalArgumentException JavaDoc("non-existant property-" + arg0 + "is specified");
30     }
31
32 }
Popular Tags