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$ ($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
 
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_POSSIBLE_CSRF, 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 workspaceId)
          Delegate to the inner context.
 HierarchyManager getHierarchyManager(String workspaceId)
          Delegate to the inner context.
 javax.jcr.Session getJCRSession(String workspaceName)
           
 QueryManager getQueryManager(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. jcr sessions).
 
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, getAttribute, getAttributeStrategy, 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
 

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 workspaceId)
Delegate to the inner context.

Overrides:
getAccessManager in class AbstractContext

getHierarchyManager

public HierarchyManager getHierarchyManager(String workspaceId)
Delegate to the inner context.

Overrides:
getHierarchyManager in class AbstractContext
Returns:
hierarchy manager

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()
Delegate to the inner context.

Overrides:
getUser in class AbstractContext

getQueryManager

public QueryManager getQueryManager(String workspaceId)
Delegate to the inner context.

Overrides:
getQueryManager in class AbstractContext

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–2014 Magnolia International Ltd.. All rights reserved.