Class SessionApplicationStatePersistenceStrategy
- java.lang.Object
-
- org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy
-
- All Implemented Interfaces:
ApplicationStatePersistenceStrategy
- Direct Known Subclasses:
EntityApplicationStatePersistenceStrategy,EntityApplicationStatePersistenceStrategy
public class SessionApplicationStatePersistenceStrategy extends java.lang.Object implements ApplicationStatePersistenceStrategy
Stores ASOs in theSession, which will be created as necessary.
-
-
Constructor Summary
Constructors Constructor Description SessionApplicationStatePersistenceStrategy(Request request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> java.lang.StringbuildKey(java.lang.Class<T> ssoClass)<T> booleanexists(java.lang.Class<T> ssoClass)Returns true if the SSO already exists, false if null.<T> Tget(java.lang.Class<T> ssoClass, ApplicationStateCreator<T> creator)Gets the SSO from the domain.<T> TgetIfExists(java.lang.Class<T> ssoClass)Returns the SSO if it exists or null.protected <T> java.lang.ObjectgetOrCreate(java.lang.Class<T> ssoClass, ApplicationStateCreator<T> creator)protected SessiongetSession()<T> voidset(java.lang.Class<T> ssoClass, T sso)Stores a new SSO, possibly replacing the existing one.protected <T> TtransformPersistedValue(java.lang.Object value)
-
-
-
Constructor Detail
-
SessionApplicationStatePersistenceStrategy
public SessionApplicationStatePersistenceStrategy(Request request)
-
-
Method Detail
-
getSession
protected Session getSession()
-
get
public <T> T get(java.lang.Class<T> ssoClass, ApplicationStateCreator<T> creator)
Description copied from interface:ApplicationStatePersistenceStrategyGets the SSO from the domain. If the SSO does not already exist, it is created and stored, then returned.- Specified by:
getin interfaceApplicationStatePersistenceStrategy
-
getOrCreate
protected <T> java.lang.Object getOrCreate(java.lang.Class<T> ssoClass, ApplicationStateCreator<T> creator)
-
getIfExists
public <T> T getIfExists(java.lang.Class<T> ssoClass)
Description copied from interface:ApplicationStatePersistenceStrategyReturns the SSO if it exists or null.- Specified by:
getIfExistsin interfaceApplicationStatePersistenceStrategy
-
transformPersistedValue
protected <T> T transformPersistedValue(java.lang.Object value)
-
buildKey
protected <T> java.lang.String buildKey(java.lang.Class<T> ssoClass)
-
set
public <T> void set(java.lang.Class<T> ssoClass, T sso)
Description copied from interface:ApplicationStatePersistenceStrategyStores a new SSO, possibly replacing the existing one.- Specified by:
setin interfaceApplicationStatePersistenceStrategysso- instance to store, or null to delete existing
-
exists
public <T> boolean exists(java.lang.Class<T> ssoClass)
Description copied from interface:ApplicationStatePersistenceStrategyReturns true if the SSO already exists, false if null.- Specified by:
existsin interfaceApplicationStatePersistenceStrategy
-
-