info.magnolia.context
Class ContextDecorator

java.lang.Object
  extended by info.magnolia.context.AbstractContext
      extended by info.magnolia.context.ContextDecorator
All Implemented Interfaces:
Serializable, Map, org.apache.commons.chain.Context
Direct Known Subclasses:
WorkItemContext

public class ContextDecorator
extends AbstractContext

Subclass this context if you like to decorate an other context.

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Philipp Bracher
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
protected  Context ctx
           
 
Fields inherited from class info.magnolia.context.AbstractContext
locale
 
Fields inherited from interface info.magnolia.context.Context
APPLICATION_SCOPE, ATTRIBUTE_COMMENT, ATTRIBUTE_EXCEPTION, ATTRIBUTE_MESSAGE, ATTRIBUTE_PATH, ATTRIBUTE_RECURSIVE, ATTRIBUTE_REPOSITORY, ATTRIBUTE_UUID, ATTRIBUTE_VERSION, ATTRIBUTE_VERSION_MAP, LOCAL_SCOPE, SESSION_SCOPE
 
Constructor Summary
ContextDecorator(Context ctx)
           
 
Method Summary
 AccessManager getAccessManager(String repositoryId, String workspaceId)
          Delegates call to the original context.
 Object getAttribute(String name, int scope)
          Delegates call to the original context.
 Map<String,Object> getAttributes(int scope)
          Delegates call to the original context.
 HierarchyManager getHierarchyManager(String repositoryId, String workspaceId)
          Delegates call to the original context.
 QueryManager getQueryManager(String repositoryId, String workspaceId)
          Delegates call to the original context.
 User getUser()
          Delegates call to the original context.
 Context getWrappedContext()
          Returns the context wrapped by this decorator.
 void release()
          Release any resource used by this Context (e.g.
 void removeAttribute(String name, int scope)
          Delegates call to the original context.
 void setAttribute(String name, Object value, int scope)
          Delegates call to the original context.
 
Methods inherited from class info.magnolia.context.AbstractContext
clear, containsKey, containsValue, entrySet, get, getAccessManager, getAttribute, getAttributes, getAttributeStrategy, getHierarchyManager, getLocale, getMessages, getMessages, getQueryManager, getRepositoryStrategy, isEmpty, keySet, put, putAll, remove, setAttributeStrategy, setLocale, setRepositoryStrategy, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

ctx

protected Context ctx
Constructor Detail

ContextDecorator

public ContextDecorator(Context ctx)
Parameters:
ctx - the context to decorate
Method Detail

getAccessManager

public AccessManager getAccessManager(String repositoryId,
                                      String workspaceId)
Delegates call to the original context.

Overrides:
getAccessManager in class AbstractContext
Returns:
access manager

getAttribute

public Object getAttribute(String name,
                           int scope)
Delegates call to the original context.

Overrides:
getAttribute in class AbstractContext
Parameters:
name - to which value is associated to
scope - the scope (request, session, application)
Returns:
attribute value

getAttributes

public Map<String,Object> getAttributes(int scope)
Delegates call to the original context.

Overrides:
getAttributes in class AbstractContext
Returns:
the map

getHierarchyManager

public HierarchyManager getHierarchyManager(String repositoryId,
                                            String workspaceId)
Delegates call to the original context.

Overrides:
getHierarchyManager in class AbstractContext
Returns:
hierarchy manager

getUser

public User getUser()
Delegates call to the original context.

Overrides:
getUser in class AbstractContext

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Delegates call to the original context.

Overrides:
setAttribute in class AbstractContext
Parameters:
name - is used as a key
scope - , highest level of scope from which this attribute is visible

getQueryManager

public QueryManager getQueryManager(String repositoryId,
                                    String workspaceId)
Delegates call to the original context.

Overrides:
getQueryManager in class AbstractContext
Returns:
query manager

removeAttribute

public void removeAttribute(String name,
                            int scope)
Delegates call to the original context.

Overrides:
removeAttribute in class AbstractContext

getWrappedContext

public Context getWrappedContext()
Returns the context wrapped by this decorator.

Returns:
wrapped context

release

public void release()
Description copied from class: AbstractContext
Release any resource used by this Context (e.g. jcr sessions).

Overrides:
release in class AbstractContext


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.