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:
Serializable, 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: 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
 
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(Map<String,Object> map)
          Decorate a map.
 
Method Summary
 AccessManager getAccessManager(String repositoryId, String workspaceId)
          Delegate to the inner context.
 HierarchyManager getHierarchyManager(String repositoryId, String workspaceId)
          Delegate to the inner context.
 QueryManager getQueryManager(String repositoryId, 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(Map<String,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(String repositoryId,
                                      String workspaceId)
Delegate to the inner context.

Overrides:
getAccessManager in class AbstractContext
Returns:
access manager

getHierarchyManager

public HierarchyManager getHierarchyManager(String repositoryId,
                                            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(String repositoryId,
                                    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-2012 Magnolia International Ltd.. All Rights Reserved.