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