public final class IntegrationFlowContext
extends java.lang.Object
implements org.springframework.beans.factory.BeanFactoryAware
IntegrationFlow
,
not via standard bean registration phase.
The bean of this component is provided via framework automatically. A bean name is based on the decapitalized class name. It must be injected to the target service before use.
The typical use-case, and, therefore algorithm, is:
IntegrationFlow
depending of the business logic
IntegrationFlow
in this IntegrationFlowContext
,
with optional id
and autoStartup
flag
MessagingTemplate
for that IntegrationFlow
(if it is started from the MessageChannel
) and send (or send-and-receive)
messages to the IntegrationFlow
IntegrationFlow
by its id
from this IntegrationFlowContext
Modifier and Type | Method and Description |
---|---|
org.springframework.integration.core.MessagingTemplate |
messagingTemplateFor(java.lang.String flowId)
Obtain a
MessagingTemplate with its default destination set to the input channel
of the IntegrationFlow for provided flowId . |
java.lang.String |
register(IntegrationFlow integrationFlow)
Register provided
IntegrationFlow with generated id
in the application context as a bean together with all its dependant components. |
java.lang.String |
register(IntegrationFlow integrationFlow,
boolean autoStartup)
Register provided
IntegrationFlow with generated id
in the application context as a bean together with all its dependant components. |
void |
register(java.lang.String flowId,
IntegrationFlow integrationFlow)
Register provided
IntegrationFlow under provided id
in the application context as a bean together with all its dependant components. |
void |
register(java.lang.String flowId,
IntegrationFlow integrationFlow,
boolean autoStartup)
Register provided
IntegrationFlow under provided id
in the application context as a bean together with all its dependant components. |
void |
remove(java.lang.String flowId)
Destroy an
IntegrationFlow bean (as well as all its dependant beans)
for provided flowId and clean up all the local cache for it. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public java.lang.String register(IntegrationFlow integrationFlow)
IntegrationFlow
with generated id
in the application context as a bean together with all its dependant components.
And preform its lifecycle start.integrationFlow
- the IntegrationFlow
to registerIntegrationFlow
public java.lang.String register(IntegrationFlow integrationFlow, boolean autoStartup)
IntegrationFlow
with generated id
in the application context as a bean together with all its dependant components.
And preform its lifecycle start if autoStartup == true
.integrationFlow
- the IntegrationFlow
to registerautoStartup
- to start or not the IntegrationFlow
automatically after registrationIntegrationFlow
public void register(java.lang.String flowId, IntegrationFlow integrationFlow)
IntegrationFlow
under provided id
in the application context as a bean together with all its dependant components.
And preform its lifecycle start.flowId
- the bean name to register forintegrationFlow
- the IntegrationFlow
to registerpublic void register(java.lang.String flowId, IntegrationFlow integrationFlow, boolean autoStartup)
IntegrationFlow
under provided id
in the application context as a bean together with all its dependant components.
And preform its lifecycle start.flowId
- the bean name to register forintegrationFlow
- the IntegrationFlow
to registerautoStartup
- to start or not the IntegrationFlow
automatically after registrationpublic void remove(java.lang.String flowId)
IntegrationFlow
bean (as well as all its dependant beans)
for provided flowId
and clean up all the local cache for it.flowId
- the bean name to destroy frompublic org.springframework.integration.core.MessagingTemplate messagingTemplateFor(java.lang.String flowId)
MessagingTemplate
with its default destination set to the input channel
of the IntegrationFlow
for provided flowId
.
Any IntegrationFlow
bean (not only manually registered) can be used for this method.
If IntegrationFlow
doesn't start with the MessageChannel
, the
IllegalStateException
is thrown.
flowId
- the bean name to obtain the input channel fromMessagingTemplate
instance