View Javadoc

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