|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.webflow.definition.registry.AbstractFlowDefinitionRegistryFactoryBean
org.springframework.webflow.engine.builder.AbstractFlowBuildingFlowRegistryFactoryBean
org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean
public class XmlFlowRegistryFactoryBean
A factory bean that produces a populated flow registry using an XmlFlowRegistrar. This is the simplest
implementation to use when using a Spring BeanFactory to deploy an explicit registry of XML-based Flow definitions
for execution.
By default, a configured flow definition will be assigned a registry identifier equal to the filename of the
underlying definition resource, minus the filename extension. For example, an XML-based flow definition defined in
the file flow1.xml will be identified as flow1 in the registry created by this factory
bean.
This class is also BeanFactoryAware and when used with Spring will automatically create a configured
DefaultFlowServiceLocator for loading Flow artifacts like Actions from the Spring bean factory during the
Flow registration process.
This class is also ResourceLoaderAware; when an instance is created by a Spring BeanFactory the
factory will automatically configure the XmlFlowRegistrar with a context-relative resource loader for accessing other
resources during Flow assembly.
Usage example:
<bean id="flowRegistry" class="org.springframework.webflow.engine.builder.registry.XmlFlowRegistryFactoryBean">
<property name="flowLocations" value="/WEB-INF/flows/*-flow.xml"/>
</bean>
| Constructor Summary | |
|---|---|
XmlFlowRegistryFactoryBean()
|
|
| Method Summary | |
|---|---|
protected void |
doPopulate(FlowDefinitionRegistry registry)
Template method subclasses must override to perform registry population. |
XmlFlowRegistrar |
getXmlFlowRegistrar()
Returns the configured externalized XML flow registrar. |
protected void |
init(FlowServiceLocator flowServiceLocator)
Called after properties have been set on the service locator, but before registry population. |
void |
setDocumentLoader(DocumentLoader documentLoader)
Sets the loader to load XML-based flow definition documents during flow definition assembly. |
void |
setFlowAttributes(java.util.Map flowAttributes)
Sets flow attributes from an externalized java.util.Map. |
void |
setFlowDefinitions(java.util.Properties flowDefinitions)
Convenience method for setting externalized flow definitions from a java.util.Properties map. |
void |
setFlowLocations(org.springframework.core.io.Resource[] locations)
Sets the locations (resource file paths) pointing to XML-based flow definitions. |
void |
setXmlFlowRegistrar(XmlFlowRegistrar flowRegistrar)
Set the configured externalized XML flow registrar. |
| Methods inherited from class org.springframework.webflow.engine.builder.AbstractFlowBuildingFlowRegistryFactoryBean |
|---|
createFlowServiceLocator, getBeanFactory, getBeanInvokingActionFactory, getConversionService, getExpressionParser, getFlowArtifactFactory, getFlowServiceLocator, getResourceLoader, init, setBeanFactory, setBeanInvokingActionFactory, setConversionService, setExpressionParser, setFlowArtifactFactory, setResourceLoader |
| Methods inherited from class org.springframework.webflow.definition.registry.AbstractFlowDefinitionRegistryFactoryBean |
|---|
afterPropertiesSet, createFlowDefinitionRegistry, getObject, getObjectType, getRegistry, isSingleton, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XmlFlowRegistryFactoryBean()
| Method Detail |
|---|
public XmlFlowRegistrar getXmlFlowRegistrar()
public void setXmlFlowRegistrar(XmlFlowRegistrar flowRegistrar)
public void setFlowLocations(org.springframework.core.io.Resource[] locations)
When configuring as a Spring bean definition, ANT-style resource patterns/wildcards are also supported, taking advantage of Spring's built in ResourceArrayPropertyEditor machinery.
For example:
<bean id="flowRegistry" class="org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean">
<property name="flowLocations" value="/WEB-INF/flows/*-flow.xml"/>
</bean>
Another example:
<bean id="flowRegistry" class="org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean">
<property name="flowLocations" value="classpath*:/example/flows/*-flow.xml"/>
</bean>
Flows registered from this set will be automatically assigned an id based on the filename of the matched XML
resource.
locations - the resource locationspublic void setFlowDefinitions(java.util.Properties flowDefinitions)
java.util.Properties map.
Allows for more control over the definition, including which flowId is assigned.
Each property key is the flowId and each property value is the string encoded location of the
externalized flow definition resource.
Here is the exact format:
flowId = resourceFor example:
<bean id="flowRegistry" class="org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean">
<property name="flowDefinitions">
<value>
searchFlow=/WEB-INF/flows/search-flow.xml
detailFlow=/WEB-INF/flows/detail-flow.xml
</value>
</property>
</bean>
flowDefinitions - the flow definitions, defined within a properties mappublic void setFlowAttributes(java.util.Map flowAttributes)
java.util.Map. The keys in the map are String flow ids.
The corresponding values should be java.util.Map maps containing flow attributes to be assigned to
the flow. A flow with an id not contained in the provided map will get not externally defined flow attributes
assigned.
Can be used in conjunction with both setFlowLocations(Resource[]) and
setFlowDefinitions(Properties).
flowAttributes - the flow attributes, keyed by flow idpublic void setDocumentLoader(DocumentLoader documentLoader)
documentLoader - the document loaderprotected void init(FlowServiceLocator flowServiceLocator)
AbstractFlowBuildingFlowRegistryFactoryBean
init in class AbstractFlowBuildingFlowRegistryFactoryBeanflowServiceLocator - the flow service locator to use to locate externally managed services needed during
flow building and assembly, typically used by a
FlowDefinitionRegistrarprotected void doPopulate(FlowDefinitionRegistry registry)
AbstractFlowDefinitionRegistryFactoryBean
doPopulate in class AbstractFlowBuildingFlowRegistryFactoryBeanregistry - the flow definition registry to populate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||