info.magnolia.context
Class AbstractSystemContext

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

public abstract class AbstractSystemContext
extends AbstractContext
implements SystemContext

This is the system context using the not secured HierarchyManagers. The context uses only one scope.

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 static ThreadLocal<JCRSessionStrategy> repositoryStrategyThreadLocal
           
 
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
AbstractSystemContext()
          DON'T CREATE AN OBJECT.
 
Method Summary
 Locale getLocale()
          If not yet set try to get the locale of the user.
 void removeAttribute(String name, Object value, int scope)
           
 void setAttribute(String name, Object value, int scope)
          Set attribute value, scope of the attribute is defined.
 void setLocale(Locale locale)
          Deprecated. since 4.0 - this shouldn't be exposed in the SystemContext interface. Prevent calls by throwing an UnsupportedOperationException.
 
Methods inherited from class info.magnolia.context.AbstractContext
clear, containsKey, containsValue, entrySet, get, getAccessManager, getAttribute, getAttribute, getAttributes, getAttributes, getAttributeStrategy, getHierarchyManager, getJCRSession, getMessages, getMessages, getQueryManager, getRepositoryStrategy, getSubject, getUser, isEmpty, keySet, put, putAll, release, remove, removeAttribute, setAttributeStrategy, 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 info.magnolia.context.Context
getAccessManager, getAttribute, getAttribute, getAttributes, getAttributes, getHierarchyManager, getJCRSession, getMessages, getMessages, getQueryManager, getSubject, getUser, release, removeAttribute
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Field Detail

repositoryStrategyThreadLocal

protected static ThreadLocal<JCRSessionStrategy> repositoryStrategyThreadLocal
Constructor Detail

AbstractSystemContext

public AbstractSystemContext()
DON'T CREATE AN OBJECT. The SystemContext is set by magnolia system itself. Init the scopes

Method Detail

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Description copied from interface: Context
Set attribute value, scope of the attribute is defined.

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

removeAttribute

public void removeAttribute(String name,
                            Object value,
                            int scope)

setLocale

@Deprecated
public void setLocale(Locale locale)
Deprecated. since 4.0 - this shouldn't be exposed in the SystemContext interface. Prevent calls by throwing an UnsupportedOperationException.

Specified by:
setLocale in interface SystemContext
Overrides:
setLocale in class AbstractContext

getLocale

public Locale getLocale()
Description copied from class: AbstractContext
If not yet set try to get the locale of the user. Else use the locale of the system context.

Overrides:
getLocale in class AbstractContext
See Also:
Context.getLocale()


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.