public class StandardIntegrationFlow extends Object implements IntegrationFlow, SmartLifecycle
IntegrationFlow
interface instantiated
by the Framework. Represents a logical container for the components configured
for the integration flow. It can be treated as a single component, especially
when declaring dynamically, using the
IntegrationFlowContext
.
Being the logical container for the target integration components, this class controls
the lifecycle of all those components, when its start()
and stop()
are
invoked.
This component is never autoStartup
, because all the components are
registered as beans in the application context and their initial start up phase is
controlled from the lifecycle processor automatically.
However, when we register an IntegrationFlow
dynamically using the
IntegrationFlowContext
API,
the lifecycle processor from the application context is not involved;
therefore we should control the lifecycle of the beans manually, or rely on the
IntegrationFlowContext
API.
Its created registration is autoStartup
by default and
starts the flow when it is registered. If you disable the registration's auto-
startup behavior, you are responsible for starting the flow or its component
beans.
This component doesn't track its running
state during stop()
action
and delegates directly to stop the registered components, to avoid dangling processes
after a registered IntegrationFlow
is removed from the flow context.
IntegrationFlows
,
IntegrationFlowBeanPostProcessor
,
IntegrationFlowContext
,
SmartLifecycle
DEFAULT_PHASE
Modifier and Type | Method and Description |
---|---|
void |
configure(IntegrationFlowDefinition<?> flow)
The callback-based function to declare the chain of EIP-methods to
configure an integration flow with the provided
IntegrationFlowDefinition . |
MessageChannel |
getInputChannel()
Return the first
MessageChannel component
which is essential a flow input channel. |
Map<Object,String> |
getIntegrationComponents() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
setIntegrationComponents(Map<Object,String> integrationComponents) |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
String |
toString() |
public void configure(IntegrationFlowDefinition<?> flow)
IntegrationFlow
IntegrationFlowDefinition
.configure
in interface IntegrationFlow
flow
- the IntegrationFlowDefinition
to configurepublic MessageChannel getInputChannel()
IntegrationFlow
MessageChannel
component
which is essential a flow input channel.getInputChannel
in interface IntegrationFlow
public void setIntegrationComponents(Map<Object,String> integrationComponents)
public void stop(Runnable callback)
stop
in interface SmartLifecycle
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle