A {@link Context} represents the state information that isaccessed and manipulated by the execution of a {@link Command} or a{@link Chain}. Specialized implementations of {@link Context} willtypically add JavaBeans properties that contain typesafe accessors to information that is relevant to a particular use case for this context, and/or add operations that affect the state information that is saved in the context.
Implementations of {@link Context} must also implement all of therequired and optional contracts of the java.util.Map
interface.
It is strongly recommended, but not required, that JavaBeans properties added to a particular {@link Context} implementation exhibitAttribute-Property Transparency. In other words, a value stored via a call to setFoo(value)
should be visible by calling get("foo")
, and a value stored via a call to put("foo", value)
should be visible by calling getFoo()
. If your {@link Context}implementation class exhibits this featue, it becomes easier to reuse the implementation in multiple environments, without the need to cast to a particular implementation class in order to access the property getter and setter methods.
To protect applications from evolution of this interface, specialized implementations of {@link Context} should generally be created by extendingthe provided base class ( {@link org.apache.commons.chain.impl.ContextBase}) rather than directly implementing this interface.
Applications should NOT assume that {@link Context} implementations, or the values stored in itsattributes, may be accessed from multiple threads simultaneously unless this is explicitly documented for a particular implementation.
@author Craig R. McClanahan @version $Revision: 1.6 $ $Date: 2004/02/25 00:01:07 $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|