org.apache.shale.dialog.impl
Class StatusImpl

java.lang.Object
  extended by org.apache.shale.dialog.impl.StatusImpl
All Implemented Interfaces:
Serializable, Status

public class StatusImpl
extends Object
implements Status

Class used to record the current status of executing a Dialog, plus parent Dialogs that have executed subordinate Dialogs as part of their own processing. Instances are stored in session scope, so this class MUST be serializable, and MUST NOT maintain references to application scope variabes.

Associated with each Status.Position, applications have the option to store a reference to a generic data object which (because it is referenced by a Status object stored in session scope under a well known key), is conveniently accessible for binding and lookup operations. When a Status.Position is popped, the corresponding data object reference is also released, avoiding the need for the application to manage "dialog scope" resources itself.

$Id: StatusImpl.java 419431 2006-07-06 04:38:39Z wsmoak $

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shale.dialog.Status
Status.Position
 
Constructor Summary
StatusImpl()
           
 
Method Summary
 Object getData()
          

Return the data reference (if any) for the current Status.Position.

 String getDialogName()
          

Return the name of the currently executing dialog (if any); otherwise, return null.

 String getStateName()
          

Return the name of the currently executing dialog's state (if any); otherwise, return null.

 Status.Position peek()
          

Return a Status.Position representing the currently executing dialog and state (if any); otherwise, return null.

 Status.Position pop()
          

Pop the currently executing Status.Position and return the previously executing Status.Position (if any); otherwise, return null.

 void push(Status.Position position)
          

Push the specified Status.Position, making it the currently executing one.

 void setData(Object data)
          

Set the data reference for the current Status.Position.

 void transition(String stateName)
          

Transition to the specified state in the currently executing dialog.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusImpl

public StatusImpl()
Method Detail

getData

public Object getData()

Return the data reference (if any) for the current Status.Position.

Specified by:
getData in interface Status

setData

public void setData(Object data)

Set the data reference for the current Status.Position.

Specified by:
setData in interface Status
Parameters:
data - The new data reference

getDialogName

public String getDialogName()

Return the name of the currently executing dialog (if any); otherwise, return null.

Specified by:
getDialogName in interface Status

getStateName

public String getStateName()

Return the name of the currently executing dialog's state (if any); otherwise, return null.

Specified by:
getStateName in interface Status

peek

public Status.Position peek()

Return a Status.Position representing the currently executing dialog and state (if any); otherwise, return null.

Specified by:
peek in interface Status

pop

public Status.Position pop()

Pop the currently executing Status.Position and return the previously executing Status.Position (if any); otherwise, return null.

Specified by:
pop in interface Status

push

public void push(Status.Position position)

Push the specified Status.Position, making it the currently executing one.

Specified by:
push in interface Status
Parameters:
position - The new currently executing Status.Position

transition

public void transition(String stateName)

Transition to the specified state in the currently executing dialog.

Specified by:
transition in interface Status
Parameters:
stateName - Name of the new state to be executed


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