info.magnolia.context
Class ContextDecorator

java.lang.Object
  extended by info.magnolia.context.AbstractContext
      extended by info.magnolia.context.ContextDecorator
All Implemented Interfaces:
Context, Serializable, Map

public class ContextDecorator
extends AbstractContext

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

Version:
$Revision$ ($Author$)
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 name)
          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.
 javax.jcr.Session getJCRSession(String workspaceName)
           
 QueryManager getQueryManager(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, getAttribute, getAttributes, getAttributeStrategy, getHierarchyManager, getLocale, getMessages, getMessages, getRepositoryStrategy, getSubject, 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 name)
Delegates call to the original context.

Overrides:
getAccessManager in class AbstractContext

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

getJCRSession

public javax.jcr.Session getJCRSession(String workspaceName)
                                throws javax.jcr.LoginException,
                                       javax.jcr.RepositoryException
Overrides:
getJCRSession in class AbstractContext
Throws:
javax.jcr.LoginException
javax.jcr.RepositoryException

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 workspaceId)
Delegates call to the original context.

Overrides:
getQueryManager in class AbstractContext

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-2013 Magnolia International Ltd.. All Rights Reserved.