Class ApplicationStateManagerImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.services.ApplicationStateManagerImpl
-
- All Implemented Interfaces:
ApplicationStateManager
public class ApplicationStateManagerImpl extends java.lang.Object implements ApplicationStateManager
-
-
Constructor Summary
Constructors Constructor Description ApplicationStateManagerImpl(java.util.Map<java.lang.Class,ApplicationStateContribution> configuration, ApplicationStatePersistenceStrategySource source, ObjectLocator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> booleanexists(java.lang.Class<T> ssoClass)Returns true if the SSO already exists, false if it has not yet been created.<T> Tget(java.lang.Class<T> ssoClass)For a given class, find the SSO for the class, creating it if necessary.<T> TgetIfExists(java.lang.Class<T> ssoClass)For a given class, find the SSO for the class.<T> voidset(java.lang.Class<T> ssoClass, T sso)Stores a new SSO, replacing the existing SSO (if any).
-
-
-
Constructor Detail
-
ApplicationStateManagerImpl
public ApplicationStateManagerImpl(java.util.Map<java.lang.Class,ApplicationStateContribution> configuration, ApplicationStatePersistenceStrategySource source, ObjectLocator locator)
-
-
Method Detail
-
get
public <T> T get(java.lang.Class<T> ssoClass)
Description copied from interface:ApplicationStateManagerFor a given class, find the SSO for the class, creating it if necessary. The manager has a configuration that determines how an instance is stored and created as needed. The default (when there is no configuration for a SSO type) is to instantiate the object with injected dependencies, viaObjectLocator.autobuild(Class). This allows an SSO to keep references to Tapestry IoC services or other objects that can be injected.- Specified by:
getin interfaceApplicationStateManager- Parameters:
ssoClass- identifies the SSO to access or create- Returns:
- the SSO instance
-
getIfExists
public <T> T getIfExists(java.lang.Class<T> ssoClass)
Description copied from interface:ApplicationStateManagerFor a given class, find the SSO for the class. The manager has a configuration that determines how an instance is stored.- Specified by:
getIfExistsin interfaceApplicationStateManager- Parameters:
ssoClass- identifies the SSO to access or create- Returns:
- the SSO instance or null if it does not already exist
-
set
public <T> void set(java.lang.Class<T> ssoClass, T sso)
Description copied from interface:ApplicationStateManagerStores a new SSO, replacing the existing SSO (if any). Storing the value null will delete the SSO so that it may be re-created later.- Specified by:
setin interfaceApplicationStateManager- Parameters:
ssoClass- the type of SSOsso- the SSO instance
-
exists
public <T> boolean exists(java.lang.Class<T> ssoClass)
Description copied from interface:ApplicationStateManagerReturns true if the SSO already exists, false if it has not yet been created.- Specified by:
existsin interfaceApplicationStateManager- Parameters:
ssoClass- used to select the SSO- Returns:
- true if SSO exists, false if null
-
-