1 7 package org.jboss.webservice.handler; 8 9 11 import javax.xml.rpc.handler.MessageContext ; 12 import java.util.HashMap ; 13 import java.util.Iterator ; 14 15 26 public class MessageContextImpl implements MessageContext 27 { 28 private HashMap props = new HashMap (); 30 31 37 public boolean containsProperty(String name) 38 { 39 return props.containsKey(name); 40 } 41 42 49 public Object getProperty(String name) 50 { 51 assertPropertyKey(name); 52 return props.get(name); 53 } 54 55 60 public Iterator getPropertyNames() 61 { 62 return props.keySet().iterator(); 63 } 64 65 71 public void removeProperty(String name) 72 { 73 assertPropertyKey(name); 74 props.remove(name); 75 } 76 77 86 public void setProperty(String name, Object value) 87 { 88 props.put(name, value); 89 } 90 91 94 private void assertPropertyKey(String name) 95 { 96 if (containsProperty(name) == false) 97 throw new IllegalArgumentException ("Property key not present: " + name); 98 } 99 100 } 101 | Popular Tags |