info.magnolia.context
Class SimpleContext

java.lang.Object
  extended by info.magnolia.context.AbstractContext
      extended by info.magnolia.context.AbstractMapBasedContext
          extended by info.magnolia.context.SimpleContext
All Implemented Interfaces:
java.io.Serializable, java.util.Map, org.apache.commons.chain.Context

public class SimpleContext
extends AbstractMapBasedContext

Simple context delegating methods to the thread local context. This context should never get used as the threads local context, but is usable in other contexts like for passing it to a command.

Version:
$Revision: 36506 $ ($Author: had $)
Author:
Philipp Bracher
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
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
SimpleContext()
          Uses current instance of MgnlContext at the time of creation as it's internal reference context.
SimpleContext(java.util.Map<java.lang.String,java.lang.Object> map)
          Decorate a map.
 
Method Summary
 AccessManager getAccessManager(java.lang.String repositoryId, java.lang.String workspaceId)
          Delegate to the inner context.
 HierarchyManager getHierarchyManager(java.lang.String repositoryId, java.lang.String workspaceId)
          Delegate to the inner context.
 QueryManager getQueryManager(java.lang.String repositoryId, java.lang.String workspaceId)
          Delegate to the inner context.
 User getUser()
          Delegate to the inner context.
 void release()
          Release any resource used by this Context (e.g.
 
Methods inherited from class info.magnolia.context.AbstractMapBasedContext
getAttribute, getAttributes, getAttributes, getMap, removeAttribute, setAttribute, setMap
 
Methods inherited from class info.magnolia.context.AbstractContext
clear, containsKey, containsValue, entrySet, get, getAccessManager, getAttribute, 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
 

Constructor Detail

SimpleContext

public SimpleContext()
Uses current instance of MgnlContext at the time of creation as it's internal reference context.


SimpleContext

public SimpleContext(java.util.Map<java.lang.String,java.lang.Object> map)
Decorate a map. If passed map is an instance of the context, this context will be used to obtain HM and check access instead of default context.

Method Detail

getAccessManager

public AccessManager getAccessManager(java.lang.String repositoryId,
                                      java.lang.String workspaceId)
Delegate to the inner context.

Overrides:
getAccessManager in class AbstractContext
Returns:
access manager

getHierarchyManager

public HierarchyManager getHierarchyManager(java.lang.String repositoryId,
                                            java.lang.String workspaceId)
Delegate to the inner context.

Overrides:
getHierarchyManager in class AbstractContext
Returns:
hierarchy manager

getUser

public User getUser()
Delegate to the inner context.

Overrides:
getUser in class AbstractContext

getQueryManager

public QueryManager getQueryManager(java.lang.String repositoryId,
                                    java.lang.String workspaceId)
Delegate to the inner context.

Overrides:
getQueryManager in class AbstractContext
Returns:
query manager

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