Class StandardIntegrationFlow
- All Implemented Interfaces:
Aware,BeanNameAware,Lifecycle,Phased,SmartLifecycle,IntegrationFlow,NamedComponent
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.
- Since:
- 5.0
- Author:
- Artem Bilan
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(IntegrationFlowDefinition<?> flow) The callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition.Return the firstMessageChannelcomponent which is essentially a flow input channel.Return a map of integration components managed by this flow (if any).intgetPhase()booleanbooleanvoidsetBeanName(String name) voidsetIntegrationComponents(Map<Object, String> integrationComponents) voidstart()voidstop()voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName
-
Method Details
-
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-
getComponentName
- Specified by:
getComponentNamein interfaceNamedComponent
-
getComponentType
- Specified by:
getComponentTypein interfaceNamedComponent
-
configure
Description copied from interface:IntegrationFlowThe callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition.- Specified by:
configurein interfaceIntegrationFlow- Parameters:
flow- theIntegrationFlowDefinitionto configure
-
getInputChannel
Description copied from interface:IntegrationFlowReturn the firstMessageChannelcomponent which is essentially a flow input channel.- Specified by:
getInputChannelin interfaceIntegrationFlow- Returns:
- the channel.
-
setIntegrationComponents
-
getIntegrationComponents
Description copied from interface:IntegrationFlowReturn a map of integration components managed by this flow (if any).- Specified by:
getIntegrationComponentsin interfaceIntegrationFlow- Returns:
- the map of integration components managed by this flow.
-
start
public void start() -
stop
- Specified by:
stopin interfaceSmartLifecycle
-
stop
public void stop() -
isRunning
public boolean isRunning() -
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceSmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle
-
toString
-