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