org.araneaframework
Interface Environment

All Superinterfaces:
Serializable
All Known Implementing Classes:
BaseEnvironment

public interface Environment
extends Serializable

A special data structure providing encapsulation of data needed by different components. Every Aranea component has an environment. The environment can be inhereted from the parent or be standalone. No component knows from which component the Environment comes from.

Component does know about the hooks in the environment. As different contexts are added to the environment the component in need of them is reponsible of checking them and acting upon them.

Author:
"Toomas Römer" , Jevgeni Kabanov (ekabanov at araneaframework dot org)

Field Summary
static String ENVIRONMENT_KEY
          The key that can be used to retrieve Environment (as an example a request scope attribute).
 
Method Summary
 Object getEntry(Object key)
          Returns the entry with the specified key from this Environment.
 Object requireEntry(Object key)
          Does the same as getEntry(Object), but throws a NoSuchEnvironmentEntryException if entry cannot be found.
 

Field Detail

ENVIRONMENT_KEY

public static final String ENVIRONMENT_KEY
The key that can be used to retrieve Environment (as an example a request scope attribute).

Since:
1.1
See Also:
Constant Field Values
Method Detail

getEntry

public Object getEntry(Object key)
Returns the entry with the specified key from this Environment. Returns null if the entry is not present in the environment.


requireEntry

public Object requireEntry(Object key)
                    throws NoSuchEnvironmentEntryException
Does the same as getEntry(Object), but throws a NoSuchEnvironmentEntryException if entry cannot be found.

Throws:
NoSuchEnvironmentEntryException - If environment entry could not be found.