public interface IntegrationFlowContext
IntegrationFlows,
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 instance 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
For convenience an associated IntegrationFlowContext.IntegrationFlowRegistration is returned after registration.
It can be used for access to the target IntegrationFlow or for manipulation with its lifecycle.
IntegrationFlowContext.IntegrationFlowRegistration| Modifier and Type | Interface and Description |
|---|---|
static interface |
IntegrationFlowContext.IntegrationFlowRegistration |
static interface |
IntegrationFlowContext.IntegrationFlowRegistrationBuilder
A Builder pattern implementation for the options to register
IntegrationFlow
in the application context. |
| Modifier and Type | Method and Description |
|---|---|
IntegrationFlowContext.IntegrationFlowRegistration |
getRegistrationById(String flowId)
Obtain an
IntegrationFlowContext.IntegrationFlowRegistration for the IntegrationFlow
associated with the provided flowId. |
Map<String,IntegrationFlowContext.IntegrationFlowRegistration> |
getRegistry()
Provide the state of the mapping of integration flow names to their
IntegrationFlowContext.IntegrationFlowRegistration instances. |
default boolean |
isUseIdAsPrefix(String flowId)
Return true to prefix flow bean names with the flow id and a period.
|
MessagingTemplate |
messagingTemplateFor(String flowId)
Obtain a
MessagingTemplate with its default destination set to the input channel
of the IntegrationFlow for provided flowId. |
IntegrationFlowContext.IntegrationFlowRegistrationBuilder |
registration(IntegrationFlow integrationFlow)
Associate provided
IntegrationFlow with an IntegrationFlowContext.IntegrationFlowRegistrationBuilder
for additional options and farther registration in the application context. |
void |
remove(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. |
IntegrationFlowContext.IntegrationFlowRegistrationBuilder registration(IntegrationFlow integrationFlow)
IntegrationFlow with an IntegrationFlowContext.IntegrationFlowRegistrationBuilder
for additional options and farther registration in the application context.integrationFlow - the IntegrationFlow to registerIntegrationFlowIntegrationFlowContext.IntegrationFlowRegistration getRegistrationById(String flowId)
IntegrationFlowContext.IntegrationFlowRegistration for the IntegrationFlow
associated with the provided flowId.flowId - the bean name to obtainid or nullvoid remove(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 fromMessagingTemplate messagingTemplateFor(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 instanceMap<String,IntegrationFlowContext.IntegrationFlowRegistration> getRegistry()
IntegrationFlowContext.IntegrationFlowRegistration instances.default boolean isUseIdAsPrefix(String flowId)
flowId - the flow id.