Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.servlet.state
Interface State

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
MutableState

public interface State
extends java.io.Serializable

The State interface defines a generic set of state information. States are retrieved from a StateManager, which is responsible for creating States, storing States, and deciding on a strategy for purging old states. The State interface itself is entirely immutable, but the MutableState subinterfaces adds mutability.

States are most useful for storing per-page state information. They can be directly set on a Page object using get/setState(). Developers must be careful, however, when setting a State object on a Page. That State object must have been created by the StateManager that hangs off the BajaContext.

State objects can also be used just by themselves as event tokens, to ensure that a page can only be submitted once.

State implementations are required to be threadsafe, and should be serializable.

See Also:
Page.getState(), Page.setState(oracle.cabo.servlet.state.State)

Method Summary
 void expire()
          Invalidate this state object.
 java.lang.String getID()
          Returns the ID of this state.
 StateManager getManager()
          Gets the state manager that created and maintains this State.
 java.lang.Object getValue(java.lang.Object key)
          Gets a value stored on the State.
 boolean isExpired()
          Tests whether the State has been expired.
 java.util.Enumeration keys()
          Returns an enumeration of value keys, or null if none have been added.
 

Method Detail

expire

public void expire()
Invalidate this state object. Once a State has been invalidated, it can no longer be retrieved from its StateManager.

isExpired

public boolean isExpired()
Tests whether the State has been expired.

getID

public java.lang.String getID()
Returns the ID of this state.

getManager

public StateManager getManager()
Gets the state manager that created and maintains this State.

getValue

public java.lang.Object getValue(java.lang.Object key)
Gets a value stored on the State.
See Also:
MutableState.putValue(java.lang.Object, java.lang.Object)

keys

public java.util.Enumeration keys()
Returns an enumeration of value keys, or null if none have been added.

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.