|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@UsesMappedConfiguration(key=java.lang.Class.class, value=ApplicationStateContribution.class) public interface ApplicationStateManager
Responsible for managing session state objects, objects which persist between requests, but are not tied to any individual page or component. SSOs are also created on demand. SSOs are typically stored in the session, so that they are specific to a particular client.
The term "Application" 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). 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.
SessionState
Method Summary | ||
---|---|---|
|
exists(Class<T> ssoClass)
Returns true if the SSO already exists, false if it has not yet been created. |
|
|
get(Class<T> ssoClass)
For a given class, find the SSO for the class, creating it if necessary. |
|
|
getIfExists(Class<T> ssoClass)
For a given class, find the SSO for the class. |
|
|
set(Class<T> ssoClass,
T SSO)
Stores a new SSO, replacing the existing SSO (if any). |
Method Detail |
---|
<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 SSO
<T> void set(Class<T> ssoClass, T SSO)
ssoClass
- the type of SSOSSO
- the SSO instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |