Class ApplicationStateManagerImpl
java.lang.Object
org.apache.tapestry5.internal.services.ApplicationStateManagerImpl
- All Implemented Interfaces:
ApplicationStateManager
-
Constructor Summary
ConstructorsConstructorDescriptionApplicationStateManagerImpl
(Map<Class, ApplicationStateContribution> configuration, ApplicationStatePersistenceStrategySource source, ObjectLocator locator) -
Method Summary
Modifier and TypeMethodDescription<T> boolean
Returns true if the SSO already exists, false if it has not yet been created.<T> T
For a given class, find the SSO for the class, creating it if necessary.<T> T
getIfExists
(Class<T> ssoClass) For a given class, find the SSO for the class.<T> void
Stores a new SSO, replacing the existing SSO (if any).
-
Constructor Details
-
ApplicationStateManagerImpl
public ApplicationStateManagerImpl(Map<Class, ApplicationStateContribution> configuration, ApplicationStatePersistenceStrategySource source, ObjectLocator locator)
-
-
Method Details
-
get
Description copied from interface:ApplicationStateManager
For 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:
get
in interfaceApplicationStateManager
- Parameters:
ssoClass
- identifies the SSO to access or create- Returns:
- the SSO instance
-
getIfExists
Description copied from interface:ApplicationStateManager
For a given class, find the SSO for the class. The manager has a configuration that determines how an instance is stored.- Specified by:
getIfExists
in interfaceApplicationStateManager
- Parameters:
ssoClass
- identifies the SSO to access or create- Returns:
- the SSO instance or null if it does not already exist
-
set
Description copied from interface:ApplicationStateManager
Stores 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:
set
in interfaceApplicationStateManager
- Parameters:
ssoClass
- the type of SSOsso
- the SSO instance
-
exists
Description copied from interface:ApplicationStateManager
Returns true if the SSO already exists, false if it has not yet been created.- Specified by:
exists
in interfaceApplicationStateManager
- Parameters:
ssoClass
- used to select the SSO- Returns:
- true if SSO exists, false if null
-