1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package javax.xml.rpc.handler;
17
18 import java.util.Iterator;
19
20 /**
21 * The interface <code>MessageContext</code> abstracts the message
22 * context that is processed by a handler in the <code>handle</code>
23 * method.
24 *
25 * <p>The <code>MessageContext</code> interface provides methods to
26 * manage a property set. <code>MessageContext</code> properties
27 * enable handlers in a handler chain to share processing related
28 * state.
29 *
30 * @version 1.0
31 */
32 public interface MessageContext {
33
34 /**
35 * Sets the name and value of a property associated with the
36 * <code>MessageContext</code>. If the <code>MessageContext</code>
37 * contains a value of the same property, the old value is replaced.
38 *
39 * @param name ame of the property associated with the
40 * <code>MessageContext</code>
41 * @param value Value of the property
42 * @throws java.lang.IllegalArgumentException If some aspect
43 * the property is prevents it from being stored
44 * in the context
45 * @throws java.lang.UnsupportedOperationException If this method is
46 * not supported.
47 */
48 public abstract void setProperty(String name, Object value);
49
50 /**
51 * Gets the value of a specific property from the
52 * <code>MessageContext</code>.
53 *
54 * @param name the name of the property whose value is to be
55 * retrieved
56 * @return the value of the property
57 * @throws java.lang.IllegalArgumentException if an illegal
58 * property name is specified
59 */
60 public abstract Object getProperty(String name);
61
62 /**
63 * Removes a property (name-value pair) from the
64 * <code>MessageContext</code>.
65 *
66 * @param name the name of the property to be removed
67 *
68 * @throws java.lang.IllegalArgumentException if an illegal
69 * property name is specified
70 */
71 public abstract void removeProperty(String name);
72
73 /**
74 * Returns true if the <code>MessageContext</code> contains a property
75 * with the specified name.
76 * @param name Name of the property whose presense is to be tested
77 * @return Returns true if the MessageContext contains the
78 * property; otherwise false
79 */
80 public abstract boolean containsProperty(String name);
81
82 /**
83 * Returns an Iterator view of the names of the properties
84 * in this <code>MessageContext</code>.
85 *
86 * @return Iterator for the property names
87 */
88 public abstract Iterator getPropertyNames();
89 }
90