public class Flow
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware, org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel>, org.springframework.context.ApplicationContextAware
FlowConfiguration
Creates a Spring Integration flow
in a child application context. This facilitates reuse of the message flow
within complex messaging flows. Each flow instance may be configured by
injecting property values or referenced bean locations to allow for different
bean definitions used by the flow. In addition, beans defined in the parent
application context may be referenced or overridden in the flow application
context.
By convention the flow configuration resource locations are
classpath:META-INF/spring/integration/flows/[flow-id]/*.xml
The flow-id defaults to the bean name if not setConstructor and Description |
---|
Flow()
Default constructor
|
Flow(java.util.Properties flowProperties,
java.lang.String[] configLocations) |
Flow(java.lang.String[] configLocations) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
java.lang.String |
getBeanName() |
FlowConfiguration |
getFlowConfiguration() |
org.springframework.context.ApplicationContext |
getFlowContext() |
org.springframework.messaging.SubscribableChannel |
getFlowOutputChannel()
All flow outputs defined in the
PortConfiguration are bridged to
a single PublishSubscribeChannel |
java.util.Properties |
getProperties() |
org.springframework.messaging.MessageChannel |
resolveDestination(java.lang.String channelName) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanName(java.lang.String name) |
void |
setFlowId(java.lang.String flowId) |
void |
setFlowOutputChannel(org.springframework.messaging.SubscribableChannel flowOutputChannel)
All flow outputs defined in the
PortConfiguration are bridged to
a single PublishSubscribeChannel |
void |
setHelp(boolean help) |
void |
setProperties(java.util.Properties flowProperties) |
void |
setReferencedBeanLocations(java.lang.String[] referencedBeanLocations) |
public Flow()
public Flow(java.util.Properties flowProperties, java.lang.String[] configLocations)
flowProperties
- properties for this flow instanceconfigLocations
- Spring configuration resource locations containing
bean definitions included in the flow application contextpublic Flow(java.lang.String[] configLocations)
configLocations
- Spring configuration resource locations containing
bean definitions included in the flow application contextpublic void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public FlowConfiguration getFlowConfiguration()
public void setBeanName(java.lang.String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public java.lang.String getBeanName()
public void setFlowId(java.lang.String flowId)
flowId
- The flow identifier used to locate the flow configurationpublic void setReferencedBeanLocations(java.lang.String[] referencedBeanLocations)
referencedBeanLocations
- Additional resource locations containing
referenced bean definitionspublic void setProperties(java.util.Properties flowProperties)
flowProperties
- properties referenced in the flow definition
property placeholderspublic java.util.Properties getProperties()
public void setHelp(boolean help)
help
- if true write the flow documentation to stdout The default
document location is
"classpath:META-INF/spring/integration/flows/[flow-id]/flow.doc"public org.springframework.messaging.SubscribableChannel getFlowOutputChannel()
PortConfiguration
are bridged to
a single PublishSubscribeChannelpublic void setFlowOutputChannel(org.springframework.messaging.SubscribableChannel flowOutputChannel)
PortConfiguration
are bridged to
a single PublishSubscribeChannelflowOutputChannel
- the publish-subscribe channelpublic org.springframework.messaging.MessageChannel resolveDestination(java.lang.String channelName)
resolveDestination
in interface org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel>
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public org.springframework.context.ApplicationContext getFlowContext()