Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.4.0)

E10686-05

oracle.adf.share.statemanager
Interface StateManager

All Known Implementing Classes:
HttpSessionStateManagerImpl, StateManagerImpl, StateManagerImpl

public interface StateManager

The base StateManager interface. The state manager is designed to manage state that describes "the circumstance or condition of a being or thing at any given time" [Webster's Revised Unabridged Dictionary].

ADF/J2EE state is generally implemented as a property of an object. The state property of an object is distinct from other properties of an object in that it is usually transient and not independently searchable.

ADF components will use the common state manager to load and store states during the lifetime of an application. This inteface defines operations similar to those found in the Map interface to get, put, and remove states.

Some ADF components may require that state is durable. Durable states are those that may survive abnormal events like system crash. The common state manager will support durable states by using a persistence service to read/write state to secondary storage.

Some ADF components may also requires that state is distributable. Distributable state is defined as being available on all nodes in a distributed system. The common state manager will support distributable states by using a distribution service to share states across nodes.

To access states, the common state manager requires that each state is uniquely identified by a state id and an ADF context.

The state id is to be defined by the ADF component. State ids must be unique for a context. Ids of persistent or distributable object must also be Serializable and consistent. Consistency requires that an identifier for a state is equal across processes.

The state context is to be defined as an ADF context. Examples may include BindingContext or session.

A default singleton state manager instance will be managed by the ADF framework. Most ADF components will access the state manager from a context DefaultContext.


Method Summary
 void clearStates(java.lang.Object context)
          Removes all states for the specified conext.
 java.lang.Object getState(java.lang.Object context, java.lang.Object id)
          Returns the specified state.
 java.lang.Object getUserAttributes(java.lang.Object context, java.lang.Object id)
          Returns the user attributes of the specified state.
 void init(java.util.Hashtable env)
          Invoked by the DefaultContext when the StateManager is instantiated.
 java.util.Iterator listStateIds(java.lang.Object context)
          Returns an iterator of the save point Ids.
 java.lang.Object putState(java.lang.Object context, java.lang.Object id, java.lang.Object state)
          Registers a state.
 java.lang.Object putState(java.lang.Object context, java.lang.Object id, java.lang.Object state, Policy policy)
          Registers a state with a management policy.
 java.lang.Object putState(java.lang.Object context, java.lang.Object id, java.lang.Object state, Policy policy, java.lang.Object userAttrs)
          Registers a state with a management policy.
 java.lang.Object removeState(java.lang.Object context, java.lang.Object id)
          Removes the specified state.
 

Method Detail

init

void init(java.util.Hashtable env)
Invoked by the DefaultContext when the StateManager is instantiated. Custom implementations may use the environment to perform custom initialization of the StateManager implementation.

Parameters:
env - the default context environment

getState

java.lang.Object getState(java.lang.Object context,
                          java.lang.Object id)
Returns the specified state. If the state does not exist returns null.

Parameters:
context - the ADF context of the required state
id - the state id
Returns:
the specified state

putState

java.lang.Object putState(java.lang.Object context,
                          java.lang.Object id,
                          java.lang.Object state)
Registers a state.

Parameters:
context - the ADF context of the state
id - the state id
state - the state
Returns:
the registered state

putState

java.lang.Object putState(java.lang.Object context,
                          java.lang.Object id,
                          java.lang.Object state,
                          Policy policy)
Registers a state with a management policy. Management policies may be defined to customize how a state will be managed. The StateManager defines default management policies for most contexts. If a management policy is specified then that policy will override the default policy.

Parameters:
context - the ADF context of the state
id - the state id
state - the state
policy - the management policy.
Returns:
the registered state

removeState

java.lang.Object removeState(java.lang.Object context,
                             java.lang.Object id)
Removes the specified state. If the state does not exist returns null.

Parameters:
context - the ADF context of the required state
id - the state id
Returns:
the specified state

clearStates

void clearStates(java.lang.Object context)
Removes all states for the specified conext.

Parameters:
context - an ADF context

getUserAttributes

java.lang.Object getUserAttributes(java.lang.Object context,
                                   java.lang.Object id)
Returns the user attributes of the specified state. If the state does not exist returns null.

Parameters:
context - the ADF context of the required state
id - the state id
Returns:
the user attributes of the specified state

listStateIds

java.util.Iterator listStateIds(java.lang.Object context)
Returns an iterator of the save point Ids.

Parameters:
context - the ADF context of the required state
Returns:
Iterator of state Ids.

putState

java.lang.Object putState(java.lang.Object context,
                          java.lang.Object id,
                          java.lang.Object state,
                          Policy policy,
                          java.lang.Object userAttrs)
Registers a state with a management policy. Management policies may be defined to customize how a state will be managed. The StateManager defines default management policies for most contexts. If a management policy is specified then that policy will override the default policy.

Parameters:
context - the ADF context of the state
id - the state id
state - the state
policy - the management policy.
userAttrs - user attributes to be associated with the state.
Returns:
the registered state

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.4.0)

E10686-05

Copyright © 1997, 2011, Oracle. All rights reserved.