org.springframework.webflow.action
Class AbstractBeanInvokingAction

java.lang.Object
  extended by org.springframework.webflow.action.AbstractAction
      extended by org.springframework.webflow.action.AbstractBeanInvokingAction
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, Action

public abstract class AbstractBeanInvokingAction
extends AbstractAction

Base class for actions that delegate to methods on beans (POJOs - Plain Old Java Objects). Acts as an adapter that adapts an Object method to the Spring Web Flow Action contract.

Subclasses are required to implement the getBean(RequestContext) method, returning the bean on which a method should be invoked.

Author:
Keith Donald
See Also:
BeanInvokingActionFactory

Field Summary
 
Fields inherited from class org.springframework.webflow.action.AbstractAction
logger
 
Constructor Summary
protected AbstractBeanInvokingAction(org.springframework.binding.method.MethodSignature methodSignature)
          Creates a new bean invoking action.
 
Method Summary
protected  Event doExecute(RequestContext context)
          Template hook method subclasses should override to encapsulate their specific action execution logic.
protected abstract  java.lang.Object getBean(RequestContext context)
          Retrieves the bean to invoke a method on.
protected  org.springframework.binding.method.MethodInvoker getMethodInvoker()
          Returns the bean method invoker helper.
 ActionResultExposer getMethodResultExposer()
          Returns the configuration for how bean method return values should be exposed to an executing flow that invokes this action.
 org.springframework.binding.method.MethodSignature getMethodSignature()
          Returns the signature of the method to invoke on the target bean.
protected  ResultEventFactory getResultEventFactory()
          Returns the event adaption strategy used by this action.
 void setConversionService(org.springframework.binding.convert.ConversionService conversionService)
          Set the conversion service to perform type conversion of event parameters to method arguments as neccessary.
 void setMethodResultExposer(ActionResultExposer methodResultExposer)
          Configures how bean method return values should be exposed to an executing flow that invokes this action.
 void setResultEventFactory(ResultEventFactory resultEventFactory)
          Set the bean return value->event adaption strategy.
 
Methods inherited from class org.springframework.webflow.action.AbstractAction
afterPropertiesSet, doPostExecute, doPreExecute, error, error, execute, getActionNameForLogging, getEventFactorySupport, initAction, no, result, result, result, result, success, success, yes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBeanInvokingAction

protected AbstractBeanInvokingAction(org.springframework.binding.method.MethodSignature methodSignature)
Creates a new bean invoking action.

Parameters:
methodSignature - the signature of the method to invoke
Method Detail

getMethodSignature

public org.springframework.binding.method.MethodSignature getMethodSignature()
Returns the signature of the method to invoke on the target bean.


getMethodResultExposer

public ActionResultExposer getMethodResultExposer()
Returns the configuration for how bean method return values should be exposed to an executing flow that invokes this action.


setMethodResultExposer

public void setMethodResultExposer(ActionResultExposer methodResultExposer)
Configures how bean method return values should be exposed to an executing flow that invokes this action. This is optional. By default the bean method return values do not get exposed to the executing flow.


getResultEventFactory

protected ResultEventFactory getResultEventFactory()
Returns the event adaption strategy used by this action.


setResultEventFactory

public void setResultEventFactory(ResultEventFactory resultEventFactory)
Set the bean return value->event adaption strategy. Defaults to SuccessEventFactory, so all bean method return values will be interpreted as "success".


setConversionService

public void setConversionService(org.springframework.binding.convert.ConversionService conversionService)
Set the conversion service to perform type conversion of event parameters to method arguments as neccessary. Defaults to DefaultConversionService.


getMethodInvoker

protected org.springframework.binding.method.MethodInvoker getMethodInvoker()
Returns the bean method invoker helper.


doExecute

protected Event doExecute(RequestContext context)
                   throws java.lang.Exception
Description copied from class: AbstractAction
Template hook method subclasses should override to encapsulate their specific action execution logic.

Specified by:
doExecute in class AbstractAction
Parameters:
context - the action execution context, for accessing and setting data in "flow scope" or "request scope"
Returns:
the action result event
Throws:
java.lang.Exception - an unrecoverable exception occured, either checked or unchecked

getBean

protected abstract java.lang.Object getBean(RequestContext context)
                                     throws java.lang.Exception
Retrieves the bean to invoke a method on. Subclasses need to implement this method.

Parameters:
context - the flow execution request context
Returns:
the bean on which to invoke methods
Throws:
java.lang.Exception - when the bean cannot be retreived


Copyright © 2004-2007. All Rights Reserved.