Class IntegrationFlowAdapter
java.lang.Object
org.springframework.integration.dsl.IntegrationFlowAdapter
- All Implemented Interfaces:
Aware
,BeanNameAware
,Lifecycle
,Phased
,SmartLifecycle
,ComponentSourceAware
,IntegrationFlow
,ManageableLifecycle
,ManageableSmartLifecycle
public abstract class IntegrationFlowAdapter
extends Object
implements IntegrationFlow, ManageableSmartLifecycle, ComponentSourceAware
The base
Adapter
class for the IntegrationFlow
abstraction.
Requires the implementation for the buildFlow()
method to produce
IntegrationFlowDefinition
using one of from(java.lang.String)
support methods.
Typically, is used for target service implementation:
@Component public class MyFlowAdapter extends IntegrationFlowAdapter { @Autowired private ConnectionFactory rabbitConnectionFactory; @Override protected IntegrationFlowDefinition<?> buildFlow() { return from(Amqp.inboundAdapter(this.rabbitConnectionFactory, "myQueue")) .<String, String>transform(String::toLowerCase) .channel(c -> c.queue("myFlowAdapterOutput")); } }
- Since:
- 5.0
- Author:
- Artem Bilan
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract IntegrationFlowDefinition<?>
final void
configure
(IntegrationFlowDefinition<?> flow) The callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition
.protected IntegrationFlowBuilder
protected IntegrationFlowBuilder
from
(Class<?> serviceInterface, Consumer<GatewayProxySpec> endpointConfigurer) Start a flow from a proxy for the service interface.protected IntegrationFlowDefinition<?>
protected IntegrationFlowDefinition<?>
protected IntegrationFlowBuilder
protected IntegrationFlowDefinition<?>
from
(MessageSource<?> messageSource) protected IntegrationFlowDefinition<?>
from
(MessageSource<?> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) protected IntegrationFlowDefinition<?>
from
(MessageChannelSpec<?, ?> messageChannelSpec) protected IntegrationFlowDefinition<?>
from
(MessageProducerSpec<?, ?> messageProducerSpec) protected IntegrationFlowDefinition<?>
from
(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec) protected IntegrationFlowDefinition<?>
from
(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) protected IntegrationFlowDefinition<?>
from
(MessagingGatewaySpec<?, ?> inboundGatewaySpec) protected IntegrationFlowDefinition<?>
from
(MessageProducerSupport messageProducer) protected IntegrationFlowDefinition<?>
from
(MessagingGatewaySupport inboundGateway) protected IntegrationFlowDefinition<?>
from
(MessageChannel messageChannel) protected <T> IntegrationFlowBuilder
fromSupplier
(Supplier<T> messageSource) protected <T> IntegrationFlowBuilder
fromSupplier
(Supplier<T> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) Return the bean name populated by theBeanNameAware.setBeanName(String)
.Return a human-readable description of this bean.Return the configuration sourceObject
for this bean (maybenull
).Return the firstMessageChannel
component which is essentially a flow input channel.Return a map of integration components managed by this flow (if any).int
getPhase()
boolean
boolean
void
setBeanName
(String name) void
setComponentDescription
(String description) Set a human-readable description of this bean.void
setComponentSource
(Object source) Set a configuration sourceObject
for this bean definition.void
start()
void
stop()
void
-
Constructor Details
-
IntegrationFlowAdapter
public IntegrationFlowAdapter()
-
-
Method Details
-
setBeanName
- Specified by:
setBeanName
in interfaceBeanNameAware
-
getBeanName
Description copied from interface:ComponentSourceAware
Return the bean name populated by theBeanNameAware.setBeanName(String)
.- Specified by:
getBeanName
in interfaceComponentSourceAware
- Returns:
- the bean name.
-
setComponentSource
Description copied from interface:ComponentSourceAware
Set a configuration sourceObject
for this bean definition. For normalBeanDefinition
this is supplied by application context automatically. Could be useful when bean is registered at runtime viaSingletonBeanRegistry.registerSingleton(String, Object)
- Specified by:
setComponentSource
in interfaceComponentSourceAware
- Parameters:
source
- the configuration source
-
getComponentSource
Description copied from interface:ComponentSourceAware
Return the configuration sourceObject
for this bean (maybenull
). Usually (if not set explicitly) aBeanMetadataElement.getSource()
.- Specified by:
getComponentSource
in interfaceComponentSourceAware
- Returns:
- the configuration source for the bean (if any).
-
setComponentDescription
Description copied from interface:ComponentSourceAware
Set a human-readable description of this bean. For normal bean definition aBeanDefinition.getDescription()
is used.- Specified by:
setComponentDescription
in interfaceComponentSourceAware
- Parameters:
description
- the bean description
-
getComponentDescription
Description copied from interface:ComponentSourceAware
Return a human-readable description of this bean. Usually (if not set explicitly) aBeanDefinition.getDescription()
.- Specified by:
getComponentDescription
in interfaceComponentSourceAware
- Returns:
- the bean description (if any).
-
configure
Description copied from interface:IntegrationFlow
The callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition
.- Specified by:
configure
in interfaceIntegrationFlow
- Parameters:
flow
- theIntegrationFlowDefinition
to configure
-
getInputChannel
Description copied from interface:IntegrationFlow
Return the firstMessageChannel
component which is essentially a flow input channel.- Specified by:
getInputChannel
in interfaceIntegrationFlow
- Returns:
- the channel.
-
getIntegrationComponents
Description copied from interface:IntegrationFlow
Return a map of integration components managed by this flow (if any).- Specified by:
getIntegrationComponents
in interfaceIntegrationFlow
- Returns:
- the map of integration components managed by this flow.
-
start
public void start()- Specified by:
start
in interfaceLifecycle
- Specified by:
start
in interfaceManageableLifecycle
-
stop
- Specified by:
stop
in interfaceSmartLifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceLifecycle
- Specified by:
stop
in interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceLifecycle
- Specified by:
isRunning
in interfaceManageableLifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceSmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhase
in interfacePhased
- Specified by:
getPhase
in interfaceSmartLifecycle
-
from
-
from
-
from
-
from
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
protected IntegrationFlowDefinition<?> from(MessageSource<?> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
-
from
-
from
-
from
-
from
-
from
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec) -
from
-
fromSupplier
-
fromSupplier
protected <T> IntegrationFlowBuilder fromSupplier(Supplier<T> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
-
from
protected IntegrationFlowBuilder from(Class<?> serviceInterface, @Nullable Consumer<GatewayProxySpec> endpointConfigurer) Start a flow from a proxy for the service interface.- Parameters:
serviceInterface
- the service interface class.endpointConfigurer
- theConsumer
to configure proxy bean for gateway.- Returns:
- new
IntegrationFlowBuilder
. - Since:
- 5.2
-
from
protected IntegrationFlowBuilder from(org.reactivestreams.Publisher<? extends Message<?>> publisher) -
buildFlow
-