org.apache.tapestry5.internal.services
Class ApplicationStateManagerImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.services.ApplicationStateManagerImpl
All Implemented Interfaces:
ApplicationStateManager

public class ApplicationStateManagerImpl
extends Object
implements ApplicationStateManager


Constructor Summary
ApplicationStateManagerImpl(Map<Class,ApplicationStateContribution> configuration, ApplicationStatePersistenceStrategySource source, ObjectLocator locator)
           
 
Method Summary
<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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationStateManagerImpl

public ApplicationStateManagerImpl(Map<Class,ApplicationStateContribution> configuration,
                                   ApplicationStatePersistenceStrategySource source,
                                   ObjectLocator locator)
Method Detail

get

public <T> T get(Class<T> ssoClass)
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. A requested SSO not in the configuration is assumed to be created via a no-args constructor, and stored in the session.

Specified by:
get in interface ApplicationStateManager
Parameters:
ssoClass - identifies the SSO to access or create
Returns:
the SSO instance

getIfExists

public <T> T getIfExists(Class<T> ssoClass)
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 interface ApplicationStateManager
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(Class<T> ssoClass,
                    T sso)
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 interface ApplicationStateManager
Parameters:
ssoClass - the type of SSO
sso - the SSO instance

exists

public <T> boolean exists(Class<T> ssoClass)
Description copied from interface: ApplicationStateManager
Returns true if the SSO already exists, false if it has not yet been created.

Specified by:
exists in interface ApplicationStateManager
Parameters:
ssoClass - used to select the SSO
Returns:
true if SSO exists, false if null


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.