org.barracudamvc.plankton.data
Class ObjectRepository.SessionRepository

java.lang.Object
  extended by org.barracudamvc.plankton.data.DefaultStateMap
      extended by org.barracudamvc.plankton.data.ObjectRepository
          extended by org.barracudamvc.plankton.data.ObjectRepository.SessionRepository
All Implemented Interfaces:
StateMap
Enclosing class:
ObjectRepository

public static class ObjectRepository.SessionRepository
extends ObjectRepository

The basic idea behind this is that we want to wrap the session as a ObjectRepository object. In order to make this work, it's important that we don't actually cause the session to be instantiated unless absolutely necessary


Nested Class Summary
 
Nested classes/interfaces inherited from class org.barracudamvc.plankton.data.ObjectRepository
ObjectRepository.SessionRepository
 
Field Summary
 
Fields inherited from class org.barracudamvc.plankton.data.ObjectRepository
custom, DEFAULT, global, local, name, rawSessions, session, sessionIDs, SOFT, SOFT_THREADSAFE, softGlobal, softsession, THREADSAFE, WEAK, WEAK_THREADSAFE, weakGlobal, weaksession
 
Fields inherited from class org.barracudamvc.plankton.data.DefaultStateMap
props
 
Constructor Summary
ObjectRepository.SessionRepository()
           
ObjectRepository.SessionRepository(javax.servlet.http.HttpServletRequest ireq)
           
ObjectRepository.SessionRepository(String iname)
           
 
Method Summary
 void clearState()
          clear all state information
 javax.servlet.http.HttpSession getSession()
           
 Object getState(Object key)
          get a property in this StateMap
 Set getStateKeys()
          get a keyset for this StateMap (whether or not the set is backed by the data store depends on the implementation).
 Map getStateStore()
          get a Map that holds the state values (whether or not the Map is backed by the data store depends on the implementation).
 void putState(Object key, Object val)
          set a property in this StateMap
protected  void registerSession()
           
 Object removeState(Object key)
          remove a property in this StateMap.
 
Methods inherited from class org.barracudamvc.plankton.data.ObjectRepository
getGlobalRepository, getLocalRepository, getName, getObjectRepository, getObjectRepository, getObjectRepository, getObjectRepositoryStore, getRawSession, getRawSessionStore, getSessionRepository, getSessionRepository, getSessionStore, getSoftGlobalRepository, getSoftSessionRepository, getWeakGlobalRepository, getWeakSessionRepository, invalidateAllSessions, invalidateSession, invalidateSession, printStackTrace, printStackTrace, printStackTrace, removeLocalRepository, removeObjectRepository, removeObjectRepository, removeSessionRepository, setupSessionRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectRepository.SessionRepository

public ObjectRepository.SessionRepository()

ObjectRepository.SessionRepository

public ObjectRepository.SessionRepository(String iname)

ObjectRepository.SessionRepository

public ObjectRepository.SessionRepository(javax.servlet.http.HttpServletRequest ireq)
Method Detail

registerSession

protected void registerSession()

putState

public void putState(Object key,
                     Object val)
Description copied from class: DefaultStateMap
set a property in this StateMap

Specified by:
putState in interface StateMap
Overrides:
putState in class DefaultStateMap
Parameters:
key - the key object
val - the value object

getState

public Object getState(Object key)
Description copied from class: DefaultStateMap
get a property in this StateMap

Specified by:
getState in interface StateMap
Overrides:
getState in class DefaultStateMap
Parameters:
key - the key object
Returns:
the value for the given key

removeState

public Object removeState(Object key)
Description copied from class: DefaultStateMap
remove a property in this StateMap. This function was expanded in csc_101803_2 to support the notion of wildcarding, allowing you to remove multiple keys in one fell swoop. Basically, if the key is a String, which ends with an '*', then any keys that start with that string will be removed (and in this case, the method returns a Map of key/val pairs that got removed, rather than a single object that got removed). This approach is not quite as flexible as using regular expressions, but that would make us dependent on jdk1.4 (so we won't go there for now). Note that this class backs the ObjectRepository data structures, so this functionality applies there as well.

Specified by:
removeState in interface StateMap
Overrides:
removeState in class DefaultStateMap
Parameters:
key - the key object
Returns:
the object which was removed

getStateKeys

public Set getStateKeys()
Description copied from class: DefaultStateMap
get a keyset for this StateMap (whether or not the set is backed by the data store depends on the implementation). In this particular case, the set is backed by a copy of the underlying data structure

Specified by:
getStateKeys in interface StateMap
Overrides:
getStateKeys in class DefaultStateMap
Returns:
a Set of keys for this StateMap

getStateStore

public Map getStateStore()
Description copied from class: DefaultStateMap
get a Map that holds the state values (whether or not the Map is backed by the data store depends on the implementation). In this particular case, the map IS the underlying data store itself

Specified by:
getStateStore in interface StateMap
Overrides:
getStateStore in class DefaultStateMap
Returns:
a Map of key/val pairs for this StateMap

clearState

public void clearState()
Description copied from class: DefaultStateMap
clear all state information

Specified by:
clearState in interface StateMap
Overrides:
clearState in class DefaultStateMap

getSession

public javax.servlet.http.HttpSession getSession()


Copyright © 2006 BarracudaMVC.org All Rights Reserved.