org.apache.shale.dialog
Interface Status

All Superinterfaces:
Serializable
All Known Implementing Classes:
StatusImpl

public interface Status
extends Serializable

Status represents the current status of executing a Dialog, plus parent Dialogs that have executing subordinate Dialogs as part of their own processing. Instances are stored in session scope, so the implementation 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: Status.java 419431 2006-07-06 04:38:39Z wsmoak $


Nested Class Summary
static class Status.Position
          A Position represents a specific current State in a specific current Dialog.
 
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.
 

Method Detail

getData

Object getData()

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


setData

void setData(Object data)

Set the data reference for the current Status.Position.

Parameters:
data - The new data reference

getDialogName

String getDialogName()

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


getStateName

String getStateName()

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


peek

Status.Position peek()

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


pop

Status.Position pop()
                    throws IllegalStateException

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

Throws:
IllegalStateException - if there is no currently executing dialog

push

void push(Status.Position position)
          throws IllegalArgumentException

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

Parameters:
position - The new currently executing Status.Position
Throws:
IllegalArgumentException - if position is null

transition

void transition(String stateName)
                throws IllegalStateException

Transition to the specified state in the currently executing dialog.

Parameters:
stateName - Name of the new state to be executed
Throws:
IllegalStateException - if there is no currently executing dialog


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