01: /*
02: * Copyright 2003-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.commons.chain;
17:
18: import java.util.Map;
19:
20: /**
21: * <p>A {@link Context} represents the state information that is
22: * accessed and manipulated by the execution of a {@link Command} or a
23: * {@link Chain}. Specialized implementations of {@link Context} will
24: * typically add JavaBeans properties that contain typesafe accessors
25: * to information that is relevant to a particular use case for this
26: * context, and/or add operations that affect the state information
27: * that is saved in the context.</p>
28: *
29: * <p>Implementations of {@link Context} must also implement all of the
30: * required and optional contracts of the <code>java.util.Map</code>
31: * interface.</p>
32: *
33: * <p>It is strongly recommended, but not required, that JavaBeans
34: * properties added to a particular {@link Context} implementation exhibit
35: * <em>Attribute-Property Transparency</em>. In other words,
36: * a value stored via a call to <code>setFoo(value)</code> should be visible
37: * by calling <code>get("foo")</code>, and a value stored
38: * via a call to <code>put("foo", value)</code> should be
39: * visible by calling <code>getFoo()</code>. If your {@link Context}
40: * implementation class exhibits this featue, it becomes easier to reuse the
41: * implementation in multiple environments, without the need to cast to a
42: * particular implementation class in order to access the property getter
43: * and setter methods.</p>
44: *
45: * <p>To protect applications from evolution of this interface, specialized
46: * implementations of {@link Context} should generally be created by extending
47: * the provided base class ({@link org.apache.commons.chain.impl.ContextBase})
48: * rather than directly implementing this interface.</p>
49: *
50: * <p>Applications should <strong>NOT</strong> assume that
51: * {@link Context} implementations, or the values stored in its
52: * attributes, may be accessed from multiple threads
53: * simultaneously unless this is explicitly documented for a particular
54: * implementation.</p>
55: *
56: * @author Craig R. McClanahan
57: * @version $Revision: 155403 $ $Date: 2005-02-26 12:52:46 +0000 (Sat, 26 Feb 2005) $
58: */
59:
60: public interface Context extends Map {
61:
62: }
|