info.magnolia.context
Class AbstractMapBasedContext

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

public abstract class AbstractMapBasedContext
extends AbstractContext

This is a simple Map based implementation. Ignores scopes!

Version:
$Revision: 32667 $ ($Author: gjoseph $)
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
AbstractMapBasedContext()
           
AbstractMapBasedContext(java.util.Map<java.lang.String,java.lang.Object> map)
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name, int scope)
          Use the Map.get()
 java.util.Map<java.lang.String,java.lang.Object> getAttributes()
          Returns the inner map
 java.util.Map<java.lang.String,java.lang.Object> getAttributes(int scope)
          Ignore scope and return the inner map
 java.util.Map<java.lang.String,java.lang.Object> getMap()
           
 void removeAttribute(java.lang.String name, int scope)
          use the Map.remove()
 void setAttribute(java.lang.String name, java.lang.Object value, int scope)
          Use the Map.put()
 void setMap(java.util.Map<java.lang.String,java.lang.Object> map)
           
 
Methods inherited from class info.magnolia.context.AbstractContext
clear, containsKey, containsValue, entrySet, get, getAccessManager, getAccessManager, getAttribute, getAttributeStrategy, getHierarchyManager, getHierarchyManager, getLocale, getMessages, getMessages, getQueryManager, getQueryManager, getRepositoryStrategy, getUser, isEmpty, keySet, put, putAll, release, 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

AbstractMapBasedContext

public AbstractMapBasedContext()

AbstractMapBasedContext

public AbstractMapBasedContext(java.util.Map<java.lang.String,java.lang.Object> map)
Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value,
                         int scope)
Use the Map.put()

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

getAttribute

public java.lang.Object getAttribute(java.lang.String name,
                                     int scope)
Use the Map.get()

Overrides:
getAttribute in class AbstractContext
Parameters:
name - to which value is associated to
scope - the scope (request, session, application)
Returns:
attribute value

removeAttribute

public void removeAttribute(java.lang.String name,
                            int scope)
use the Map.remove()

Overrides:
removeAttribute in class AbstractContext

getAttributes

public java.util.Map<java.lang.String,java.lang.Object> getAttributes(int scope)
Ignore scope and return the inner map

Overrides:
getAttributes in class AbstractContext
Returns:
the map

getAttributes

public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns the inner map

Overrides:
getAttributes in class AbstractContext
Returns:
the map

getMap

public java.util.Map<java.lang.String,java.lang.Object> getMap()

setMap

public void setMap(java.util.Map<java.lang.String,java.lang.Object> map)


Copyright © 2003-2010 Magnolia International Ltd.. All Rights Reserved.