org.apache.tapestry5.internal.services
Class SessionApplicationStatePersistenceStrategy

java.lang.Object
  extended by org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy
All Implemented Interfaces:
ApplicationStatePersistenceStrategy
Direct Known Subclasses:
EntityApplicationStatePersistenceStrategy, EntityApplicationStatePersistenceStrategy

public class SessionApplicationStatePersistenceStrategy
extends Object
implements ApplicationStatePersistenceStrategy

Stores ASOs in the Session, which will be created as necessary.


Constructor Summary
SessionApplicationStatePersistenceStrategy(Request request)
           
 
Method Summary
protected
<T> String
buildKey(Class<T> ssoClass)
           
<T> boolean
exists(Class<T> ssoClass)
          Returns true if the SSO already exists, false if null.
<T> T
get(Class<T> ssoClass, ApplicationStateCreator<T> creator)
          Gets the SSO from the domain.
protected
<T> Object
getOrCreate(Class<T> ssoClass, ApplicationStateCreator<T> creator)
           
protected  Session getSession()
           
<T> void
set(Class<T> ssoClass, T sso)
          Stores a new SSO, possibly replacing the existing one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionApplicationStatePersistenceStrategy

public SessionApplicationStatePersistenceStrategy(Request request)
Method Detail

getSession

protected Session getSession()

get

public <T> T get(Class<T> ssoClass,
                 ApplicationStateCreator<T> creator)
Description copied from interface: ApplicationStatePersistenceStrategy
Gets the SSO from the domain. If the ASO does not already exist, it is created and stored, then returned.

Specified by:
get in interface ApplicationStatePersistenceStrategy

getOrCreate

protected <T> Object getOrCreate(Class<T> ssoClass,
                                 ApplicationStateCreator<T> creator)

buildKey

protected <T> String buildKey(Class<T> ssoClass)

set

public <T> void set(Class<T> ssoClass,
                    T sso)
Description copied from interface: ApplicationStatePersistenceStrategy
Stores a new SSO, possibly replacing the existing one.

Specified by:
set in interface ApplicationStatePersistenceStrategy
sso - instance to store, or null to delete existing

exists

public <T> boolean exists(Class<T> ssoClass)
Description copied from interface: ApplicationStatePersistenceStrategy
Returns true if the SSO already exists, false if null.

Specified by:
exists in interface ApplicationStatePersistenceStrategy


Copyright © 2003-2012 The Apache Software Foundation.