org.springframework.webflow.engine.builder
Class BaseFlowServiceLocator

java.lang.Object
  extended by org.springframework.webflow.engine.builder.BaseFlowServiceLocator
All Implemented Interfaces:
FlowServiceLocator
Direct Known Subclasses:
DefaultFlowServiceLocator

public class BaseFlowServiceLocator
extends java.lang.Object
implements FlowServiceLocator

Base implementation that implements a minimal set of the FlowServiceLocator interface, throwing unsupported operation exceptions for some operations.

May be subclassed to offer additional factory/lookup support.

Author:
Keith Donald

Constructor Summary
BaseFlowServiceLocator()
           
 
Method Summary
protected  void addWebFlowConverters(org.springframework.binding.convert.support.GenericConversionService conversionService)
          Add all web flow specific converters to given conversion service.
protected  boolean containsBean(java.lang.String id)
          Helper method for determining if the configured bean factory contains the provided bean.
protected  org.springframework.binding.convert.ConversionService createConversionService(org.springframework.binding.convert.ConversionService userConversionService)
          Setup a conversion service used by this flow service locator.
 Action getAction(java.lang.String id)
          Retrieve an action to be executed within a flow with the assigned id.
 FlowAttributeMapper getAttributeMapper(java.lang.String id)
          Returns the flow attribute mapper with the provided id.
protected  java.lang.Object getBean(java.lang.String id, java.lang.Class artifactType)
          Helper method to lookup the bean representing a flow artifact of the specified type.
 org.springframework.beans.factory.BeanFactory getBeanFactory()
          Returns a generic bean (service) registry for accessing arbitrary beans.
 BeanInvokingActionFactory getBeanInvokingActionFactory()
          Returns the factory for bean invoking actions.
protected  java.lang.Class getBeanType(java.lang.String id, java.lang.Class artifactType)
          Helper method to lookup the type of the bean with the provided id.
 org.springframework.binding.convert.ConversionService getConversionService()
          Returns a generic type conversion service for converting between types, typically from string to a rich value object.
 FlowExecutionExceptionHandler getExceptionHandler(java.lang.String id)
          Returns the exception handler to handle flow execution exceptions with the provided id.
 org.springframework.binding.expression.ExpressionParser getExpressionParser()
          Returns the expression parser for parsing expression strings.
 FlowArtifactFactory getFlowArtifactFactory()
          Returns the factory for core flow artifacts such as Flow and State.
 org.springframework.core.io.ResourceLoader getResourceLoader()
          Returns a generic resource loader for accessing file-based resources.
 Flow getSubflow(java.lang.String id)
          Returns the Flow to be used as a subflow with the provided id.
 TargetStateResolver getTargetStateResolver(java.lang.String id)
          Returns the transition target state resolver with the specified id.
 TransitionCriteria getTransitionCriteria(java.lang.String id)
          Returns the transition criteria to drive state transitions with the provided id.
 ViewSelector getViewSelector(java.lang.String id)
          Returns the view selector to make view selections in view states with the provided id.
 void setBeanInvokingActionFactory(BeanInvokingActionFactory beanInvokingActionFactory)
          Sets the factory for creating bean invoking actions, actions that adapt methods on objects to the Action interface.
 void setConversionService(org.springframework.binding.convert.ConversionService userConversionService)
          Set the conversion service to use to convert between types; typically from string to a rich object type.
 void setExpressionParser(org.springframework.binding.expression.ExpressionParser expressionParser)
          Set the expression parser responsible for parsing expression strings into evaluatable expression objects.
 void setFlowArtifactFactory(FlowArtifactFactory flowArtifactFactory)
          Sets the factory encapsulating the creation of central Flow artifacts such as flows and states.
 void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
          Set the resource loader to load file-based resources from string-encoded paths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseFlowServiceLocator

public BaseFlowServiceLocator()
Method Detail

setFlowArtifactFactory

public void setFlowArtifactFactory(FlowArtifactFactory flowArtifactFactory)
Sets the factory encapsulating the creation of central Flow artifacts such as flows and states.


setBeanInvokingActionFactory

public void setBeanInvokingActionFactory(BeanInvokingActionFactory beanInvokingActionFactory)
Sets the factory for creating bean invoking actions, actions that adapt methods on objects to the Action interface.


setExpressionParser

public void setExpressionParser(org.springframework.binding.expression.ExpressionParser expressionParser)
Set the expression parser responsible for parsing expression strings into evaluatable expression objects.


setConversionService

public void setConversionService(org.springframework.binding.convert.ConversionService userConversionService)
Set the conversion service to use to convert between types; typically from string to a rich object type.


setResourceLoader

public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Set the resource loader to load file-based resources from string-encoded paths. This is optional.


getSubflow

public Flow getSubflow(java.lang.String id)
                throws FlowArtifactLookupException
Description copied from interface: FlowServiceLocator
Returns the Flow to be used as a subflow with the provided id.

Specified by:
getSubflow in interface FlowServiceLocator
Parameters:
id - the flow id
Returns:
the flow to be used as a subflow
Throws:
FlowArtifactLookupException - when no such flow is found

getAction

public Action getAction(java.lang.String id)
                 throws FlowArtifactLookupException
Description copied from interface: FlowServiceLocator
Retrieve an action to be executed within a flow with the assigned id.

Specified by:
getAction in interface FlowServiceLocator
Parameters:
id - the id of the action
Throws:
FlowArtifactLookupException - when no such action is found

getAttributeMapper

public FlowAttributeMapper getAttributeMapper(java.lang.String id)
                                       throws FlowArtifactLookupException
Description copied from interface: FlowServiceLocator
Returns the flow attribute mapper with the provided id. Flow attribute mappers are used from subflow states to map input and output attributes.

Specified by:
getAttributeMapper in interface FlowServiceLocator
Parameters:
id - the attribute mapper id
Returns:
the attribute mapper
Throws:
FlowArtifactLookupException - when no such mapper is found

getTransitionCriteria

public TransitionCriteria getTransitionCriteria(java.lang.String id)
                                         throws FlowArtifactLookupException
Description copied from interface: FlowServiceLocator
Returns the transition criteria to drive state transitions with the provided id.

Specified by:
getTransitionCriteria in interface FlowServiceLocator
Parameters:
id - the transition criteria id
Returns:
the transition criteria
Throws:
FlowArtifactLookupException - when no such criteria is found

getTargetStateResolver

public TargetStateResolver getTargetStateResolver(java.lang.String id)
                                           throws FlowArtifactLookupException
Description copied from interface: FlowServiceLocator
Returns the transition target state resolver with the specified id.

Specified by:
getTargetStateResolver in interface FlowServiceLocator
Parameters:
id - the target state resolver id
Returns:
the target state resolver
Throws:
FlowArtifactLookupException - when no such resolver is found

getViewSelector

public ViewSelector getViewSelector(java.lang.String id)
                             throws FlowArtifactLookupException
Description copied from interface: FlowServiceLocator
Returns the view selector to make view selections in view states with the provided id.

Specified by:
getViewSelector in interface FlowServiceLocator
Parameters:
id - the view selector id
Returns:
the view selector
Throws:
FlowArtifactLookupException - when no such selector is found

getExceptionHandler

public FlowExecutionExceptionHandler getExceptionHandler(java.lang.String id)
                                                  throws FlowArtifactLookupException
Description copied from interface: FlowServiceLocator
Returns the exception handler to handle flow execution exceptions with the provided id.

Specified by:
getExceptionHandler in interface FlowServiceLocator
Parameters:
id - the exception handler id
Returns:
the exception handler
Throws:
FlowArtifactLookupException - when no such handler is found

getFlowArtifactFactory

public FlowArtifactFactory getFlowArtifactFactory()
Description copied from interface: FlowServiceLocator
Returns the factory for core flow artifacts such as Flow and State.

Specified by:
getFlowArtifactFactory in interface FlowServiceLocator
Returns:
the flow artifact factory

getBeanInvokingActionFactory

public BeanInvokingActionFactory getBeanInvokingActionFactory()
Description copied from interface: FlowServiceLocator
Returns the factory for bean invoking actions.

Specified by:
getBeanInvokingActionFactory in interface FlowServiceLocator
Returns:
the bean invoking action factory

getBeanFactory

public org.springframework.beans.factory.BeanFactory getBeanFactory()
                                                             throws java.lang.UnsupportedOperationException
Description copied from interface: FlowServiceLocator
Returns a generic bean (service) registry for accessing arbitrary beans.

Specified by:
getBeanFactory in interface FlowServiceLocator
Returns:
the generic service registry
Throws:
java.lang.UnsupportedOperationException - when not supported by this locator

getResourceLoader

public org.springframework.core.io.ResourceLoader getResourceLoader()
Description copied from interface: FlowServiceLocator
Returns a generic resource loader for accessing file-based resources.

Specified by:
getResourceLoader in interface FlowServiceLocator
Returns:
the generic resource loader

getExpressionParser

public org.springframework.binding.expression.ExpressionParser getExpressionParser()
Description copied from interface: FlowServiceLocator
Returns the expression parser for parsing expression strings.

Specified by:
getExpressionParser in interface FlowServiceLocator
Returns:
the expression parser

getConversionService

public org.springframework.binding.convert.ConversionService getConversionService()
Description copied from interface: FlowServiceLocator
Returns a generic type conversion service for converting between types, typically from string to a rich value object.

Specified by:
getConversionService in interface FlowServiceLocator
Returns:
the generic conversion service

containsBean

protected boolean containsBean(java.lang.String id)
Helper method for determining if the configured bean factory contains the provided bean.

Parameters:
id - the id of the bean
Returns:
true if yes, false otherwise

getBean

protected java.lang.Object getBean(java.lang.String id,
                                   java.lang.Class artifactType)
                            throws FlowArtifactLookupException
Helper method to lookup the bean representing a flow artifact of the specified type.

Parameters:
id - the bean id
artifactType - the bean type
Returns:
the bean
Throws:
FlowArtifactLookupException - an exception occurred

getBeanType

protected java.lang.Class getBeanType(java.lang.String id,
                                      java.lang.Class artifactType)
                               throws FlowArtifactLookupException
Helper method to lookup the type of the bean with the provided id.

Parameters:
id - the bean id
artifactType - the bean type
Returns:
the bean's type
Throws:
FlowArtifactLookupException - an exception occurred

createConversionService

protected org.springframework.binding.convert.ConversionService createConversionService(org.springframework.binding.convert.ConversionService userConversionService)
Setup a conversion service used by this flow service locator.

Parameters:
userConversionService - a user supplied conversion service, optional
Returns:
the newly created conversion service

addWebFlowConverters

protected void addWebFlowConverters(org.springframework.binding.convert.support.GenericConversionService conversionService)
Add all web flow specific converters to given conversion service.



Copyright © 2004-2007. All Rights Reserved.