org.apache.cocoon.components
Class ComponentContext

java.lang.Object
  extended by org.apache.avalon.framework.context.DefaultContext
      extended by org.apache.cocoon.components.ComponentContext
All Implemented Interfaces:
Serializable, Context

public class ComponentContext
extends DefaultContext

This is the Context implementation for Cocoon components. It extends the DefaultContext by a special handling for getting objects from the object model and other application information.

Version:
CVS $Id: ComponentContext.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler
See Also:
ContextHelper, Serialized Form

Nested Class Summary
static class ComponentContext.ComponentManagerWrapper
           
static class ComponentContext.ComponentSelectorWrapper
           
 
Field Summary
protected static String OBJECT_MODEL_KEY_PREFIX
           
 
Constructor Summary
ComponentContext()
          Create a Context with no parent.
ComponentContext(Context parent)
          Create a Context with specified parent.
ComponentContext(Map contextData)
          Create a Context with specified data.
ComponentContext(Map contextData, Context parent)
          Create a Context with specified data and parent.
 
Method Summary
 Object get(Object key)
          Retrieve an item from the Context.
 
Methods inherited from class org.apache.avalon.framework.context.DefaultContext
checkWriteable, equals, getContextData, getParent, hashCode, hide, makeReadOnly, put
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_MODEL_KEY_PREFIX

protected static final String OBJECT_MODEL_KEY_PREFIX
See Also:
Constant Field Values
Constructor Detail

ComponentContext

public ComponentContext(Map contextData,
                        Context parent)
Create a Context with specified data and parent.

Parameters:
contextData - the context data
parent - the parent Context (may be null)

ComponentContext

public ComponentContext(Map contextData)
Create a Context with specified data.

Parameters:
contextData - the context data

ComponentContext

public ComponentContext(Context parent)
Create a Context with specified parent.

Parameters:
parent - the parent Context (may be null)

ComponentContext

public ComponentContext()
Create a Context with no parent.

Method Detail

get

public Object get(Object key)
           throws ContextException
Retrieve an item from the Context.

Specified by:
get in interface Context
Overrides:
get in class DefaultContext
Parameters:
key - the key of item
Returns:
the item stored in context
Throws:
ContextException - if item not present


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.