@UsesMappedConfiguration(key=java.lang.Class.class, value=ApplicationStateContribution.class) public interface ApplicationStateManager
SSOs are created on demand.
Tapestry has a built-in default strategy for storing SSOs (in the session) and instantiating them. If desired, contributions to the service configuration can override the default behavior, either specifying an alternate storage strategy, or an alternate creation strategy.
NOTE: The term "Application" here is a hold-over from Tapestry 5.0, which used the @ApplicationState (deprecated and deleted) annotation, and called them "ASOs" (Application State Objects). This service would be better named "SessionStateManager" (but renaming it would cause backwards compatibility issues).
SessionState
Modifier and Type | Method and Description |
---|---|
<T> boolean |
exists(Class<T> ssoClass)
Returns true if the SSO already exists, false if it has not yet been created.
|
<T> T |
get(Class<T> ssoClass)
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 |
set(Class<T> ssoClass,
T SSO)
Stores a new SSO, replacing the existing SSO (if any).
|
<T> T get(Class<T> ssoClass)
ObjectLocator.autobuild(Class)
.
This
allows an SSO to keep references to Tapestry IoC services or other objects that can be injected.ssoClass
- identifies the SSO to access or create<T> T getIfExists(Class<T> ssoClass)
ssoClass
- identifies the SSO to access or create<T> boolean exists(Class<T> ssoClass)
ssoClass
- used to select the SSO5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.