org.springframework.webflow.executor.support
Class ResponseInstructionHandler

java.lang.Object
  extended by org.springframework.webflow.executor.support.ResponseInstructionHandler

public abstract class ResponseInstructionHandler
extends java.lang.Object

Abstract helper class that allows easy handling of all known view selection types. Users need to implement each of the hook methods dealing with a particular type of view selection, typically in an anonymous inner subclass of this class.

Since:
1.0.2
Author:
Erwin Vervaet
See Also:
ViewSelection

Nested Class Summary
static class ResponseInstructionHandler.RuntimeResponseHandlingException
          Thrown during handleQuietly.
 
Constructor Summary
ResponseInstructionHandler()
           
 
Method Summary
 java.lang.Object getResult()
          Returns the object resulting from response handling.
 ResponseInstructionHandler handle(ResponseInstruction responseInstruction)
          Issue a response for given response instruction.
protected abstract  void handleApplicationView(ApplicationView view)
          Issue a response for given application view.
protected abstract  void handleExternalRedirect(ExternalRedirect redirect)
          Issue a response for given external redirect.
protected abstract  void handleFlowDefinitionRedirect(FlowDefinitionRedirect redirect)
          Issue a response for given flow definition redirect.
protected abstract  void handleFlowExecutionRedirect(FlowExecutionRedirect redirect)
          Issue a response for given flow execution redirect.
protected abstract  void handleNull()
          Issue a respone for the null view selection.
 ResponseInstructionHandler handleQuietly(ResponseInstruction responseInstruction)
          Quietly issue a response for given response instruction, turning any Exception raised while handling the response instruction into a RuntimeException.
 void setResult(java.lang.Object result)
          Set the object resulting from response handling.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseInstructionHandler

public ResponseInstructionHandler()
Method Detail

setResult

public void setResult(java.lang.Object result)
Set the object resulting from response handling. This is optional.

Parameters:
result - the result object

getResult

public java.lang.Object getResult()
Returns the object resulting from response handling. This is optional and will only be set if the subclass calls setResult(Object) to set the result object.

Returns:
the result object, or null if none

handle

public final ResponseInstructionHandler handle(ResponseInstruction responseInstruction)
                                        throws java.lang.Exception
Issue a response for given response instruction. Will delegate to any of the available hook methods depending on the type of view selection contained in the response instruction.

Parameters:
responseInstruction - the response instruction to issue a response for
Returns:
this object, for call chaining
Throws:
ResponseInstructionHandler.RuntimeResponseHandlingException - when an error occured
java.lang.Exception

handleQuietly

public final ResponseInstructionHandler handleQuietly(ResponseInstruction responseInstruction)
Quietly issue a response for given response instruction, turning any Exception raised while handling the response instruction into a RuntimeException. Will delegate to any of the available hook methods depending on the type of view selection contained in the response instruction.

Parameters:
responseInstruction - the response instruction to issue a response for
Returns:
this object, for call chaining

handleApplicationView

protected abstract void handleApplicationView(ApplicationView view)
                                       throws java.lang.Exception
Issue a response for given application view.

Parameters:
view - the application view to issue a response for
Throws:
ResponseInstructionHandler.RuntimeResponseHandlingException - when an error occured
java.lang.Exception
See Also:
ResponseInstruction.isActiveView(), ApplicationView

handleFlowDefinitionRedirect

protected abstract void handleFlowDefinitionRedirect(FlowDefinitionRedirect redirect)
                                              throws java.lang.Exception
Issue a response for given flow definition redirect.

Parameters:
redirect - the flow definition redirect to issue a response for
Throws:
ResponseInstructionHandler.RuntimeResponseHandlingException - when an error occured
java.lang.Exception
See Also:
ResponseInstruction.isFlowDefinitionRedirect(), FlowDefinitionRedirect

handleFlowExecutionRedirect

protected abstract void handleFlowExecutionRedirect(FlowExecutionRedirect redirect)
                                             throws java.lang.Exception
Issue a response for given flow execution redirect.

Parameters:
redirect - the flow execution redirect to issue a response for
Throws:
ResponseInstructionHandler.RuntimeResponseHandlingException - when an error occured
java.lang.Exception
See Also:
ResponseInstruction.isFlowExecutionRedirect(), FlowExecutionRedirect

handleExternalRedirect

protected abstract void handleExternalRedirect(ExternalRedirect redirect)
                                        throws java.lang.Exception
Issue a response for given external redirect.

Parameters:
redirect - the external redirect to issue a response for
Throws:
ResponseInstructionHandler.RuntimeResponseHandlingException - when an error occured
java.lang.Exception
See Also:
ResponseInstruction.isExternalRedirect(), ExternalRedirect

handleNull

protected abstract void handleNull()
                            throws java.lang.Exception
Issue a respone for the null view selection.

Throws:
ResponseInstructionHandler.RuntimeResponseHandlingException
java.lang.Exception
See Also:
ResponseInstruction.isNull(), ViewSelection.NULL_VIEW


Copyright © 2004-2007. All Rights Reserved.