Class EndpointSpec<S extends EndpointSpec<S,F,H>,F extends BeanNameAware & FactoryBean<? extends AbstractEndpoint>,H>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,reactor.util.function.Tuple2<F,H>>
org.springframework.integration.dsl.EndpointSpec<S,F,H>
- Type Parameters:
S
- the targetConsumerEndpointSpec
implementation type.F
- the targetBeanNameAware
implementation type.H
- the targetMessageHandler
implementation type.
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<reactor.util.function.Tuple2<F,H>>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
ConsumerEndpointSpec
,SourcePollingChannelAdapterSpec
public abstract class EndpointSpec<S extends EndpointSpec<S,F,H>,F extends BeanNameAware & FactoryBean<? extends AbstractEndpoint>,H> extends IntegrationComponentSpec<S,reactor.util.function.Tuple2<F,H>> implements ComponentsRegistration
An
IntegrationComponentSpec
for endpoints.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Field Summary
Fields Modifier and Type Field Description protected Map<Object,String>
componentsToRegister
protected F
endpointFactoryBean
protected H
handler
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
Constructor Summary
Constructors Modifier Constructor Description protected
EndpointSpec(H handler, F endpointFactoryBean)
-
Method Summary
Modifier and Type Method Description protected void
assertHandler()
abstract S
autoStartup(boolean autoStartup)
protected reactor.util.function.Tuple2<F,H>
doGet()
Map<Object,String>
getComponentsToRegister()
S
id(String id)
Configure the component identifier.protected MessageChannel
obtainInputChannelFromFlow(IntegrationFlow subFlow)
Try to get aMessageChannel
as an input for the providedIntegrationFlow
or create one and wrap the provided flow to a new one.protected MessageChannel
obtainInputChannelFromFlow(IntegrationFlow subFlow, boolean evaluateInternalBuilder)
Try to get aMessageChannel
as an input for the providedIntegrationFlow
or create one and wrap the provided flow to a new one.abstract S
phase(int phase)
S
poller(Function<PollerFactory,PollerSpec> pollers)
S
poller(PollerSpec pollerMetadataSpec)
abstract S
poller(PollerMetadata pollerMetadata)
abstract S
role(String role)
Specify the role for the endpoint.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
componentsToRegister
-
endpointFactoryBean
protected final F extends BeanNameAware & FactoryBean<? extends AbstractEndpoint> endpointFactoryBean -
handler
-
-
Constructor Details
-
Method Details
-
id
Description copied from class:IntegrationComponentSpec
Configure the component identifier. Used as thebeanName
to register the bean in the application context for this component.- Overrides:
id
in classIntegrationComponentSpec<S extends EndpointSpec<S,F,H>,reactor.util.function.Tuple2<F extends BeanNameAware & FactoryBean<? extends AbstractEndpoint>,H>>
- Parameters:
id
- the id.- Returns:
- the spec.
-
poller
- Parameters:
pollers
- the pollers- Returns:
- the endpoint spec.
- See Also:
AbstractPollingEndpoint
,PollerFactory
-
poller
- Parameters:
pollerMetadataSpec
- the pollerMetadataSpec- Returns:
- the endpoint spec.
- See Also:
AbstractPollingEndpoint
,PollerSpec
-
poller
- Parameters:
pollerMetadata
- the pollerMetadata- Returns:
- the endpoint spec.
- See Also:
AbstractPollingEndpoint
-
phase
- Parameters:
phase
- the phase.- Returns:
- the endpoint spec.
- See Also:
SmartLifecycle
-
autoStartup
- Parameters:
autoStartup
- the autoStartup.- Returns:
- the endpoint spec
- See Also:
SmartLifecycle
-
role
Specify the role for the endpoint. Such endpoints can be started/stopped as a group.- Parameters:
role
- the role for this endpoint.- Returns:
- the endpoint spec
- See Also:
SmartLifecycle
,SmartLifecycleRoleController
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-
doGet
- Overrides:
doGet
in classIntegrationComponentSpec<S extends EndpointSpec<S,F,H>,reactor.util.function.Tuple2<F extends BeanNameAware & FactoryBean<? extends AbstractEndpoint>,H>>
-
assertHandler
protected void assertHandler() -
obtainInputChannelFromFlow
Try to get aMessageChannel
as an input for the providedIntegrationFlow
or create one and wrap the provided flow to a new one.- Parameters:
subFlow
- theIntegrationFlow
to extract input channel.- Returns:
- the input channel of the flow of create one
- Since:
- 5.0.4
-
obtainInputChannelFromFlow
protected MessageChannel obtainInputChannelFromFlow(IntegrationFlow subFlow, boolean evaluateInternalBuilder)Try to get aMessageChannel
as an input for the providedIntegrationFlow
or create one and wrap the provided flow to a new one.- Parameters:
subFlow
- theIntegrationFlow
to extract input channel.evaluateInternalBuilder
- true if an internalIntegrationFlowDefinition
should be evaluated to anIntegrationFlow
component or left as a builder in thecomponentsToRegister
for future use-case. For example the builder is used for router configurations to retain beans registration order for parent-child dependencies.- Returns:
- the input channel of the flow of create one
- Since:
- 5.0.4
-