com.tonbeller.jpivot.tags
Interface StateManager

All Known Implementing Classes:
PageStateManager, StackStateManager

public interface StateManager

Manages state of JSPs.

Example: the user displays customerdetail.jsp for customer A, then productdetail.jsp for product B, and then again customerdetail.jsp for customer C. What should happen to A and B at this point? There are two possible strategies: stack and page.

PageStateStrategy preserves the latest state for every page. In the example A will be destroyed and B and C will be preserved. So the user can display the productdetails.jsp with B and the customerdetail.jsp with C using browser history buttons.

StackStateStrategy puts the pages into a stack. In the example, first customerdetail.jsp/A is pushed, then productdetail.jsp/B is pushed. In the last step, productdetail.jsp is popped because there is already a customerdetail.jsp on the stack. After productdetail.jsp is popped, the associated value of customerdetail.jsp is changed from A to C. The stack will only contain the value C for customerdetail.jsp, the values A and B will be destroyed.

Since:
15.02.2005
Author:
av

Nested Class Summary
static interface StateManager.State
          lifecycle: initialize() -> show() -> hide() -> ... -> show() -> hide() -> destroy()
 
Method Summary
 void destroyAll()
          removes all states
 void destroyByName(java.lang.String name)
          removes + destroys a named state
 StateLogger getLogger()
           
 void initializeAndShow(StateManager.State s)
          makes s the current state.
 void setLogger(StateLogger logger)
          logger for debug/test
 void showByName(java.lang.String name)
          makes a state with name the current state.
 

Method Detail

initializeAndShow

void initializeAndShow(StateManager.State s)
                       throws java.lang.Exception
makes s the current state. If there is already another state with the name of s, it will be destroyed and replaced by s.

Throws:
java.lang.Exception

showByName

void showByName(java.lang.String name)
                throws java.lang.Exception
makes a state with name the current state.

Throws:
java.lang.Exception

destroyAll

void destroyAll()
                throws java.lang.Exception
removes all states

Throws:
java.lang.Exception

destroyByName

void destroyByName(java.lang.String name)
                   throws java.lang.Exception
removes + destroys a named state

Throws:
java.lang.Exception

setLogger

void setLogger(StateLogger logger)
logger for debug/test


getLogger

StateLogger getLogger()