Class EndpointSpec<S extends EndpointSpec<S,​F,​H>,​F extends org.springframework.beans.factory.BeanNameAware,​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 target ConsumerEndpointSpec implementation type.
F - the target BeanNameAware implementation type.
H - the target MessageHandler implementation type.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<reactor.util.function.Tuple2<F,​H>>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, ComponentsRegistration
Direct Known Subclasses:
ConsumerEndpointSpec, SourcePollingChannelAdapterSpec

public abstract class EndpointSpec<S extends EndpointSpec<S,​F,​H>,​F extends org.springframework.beans.factory.BeanNameAware,​H>
extends IntegrationComponentSpec<S,​reactor.util.function.Tuple2<F,​H>>
implements ComponentsRegistration
An IntegrationComponentSpec for endpoints.
Since:
5.0
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Map<java.lang.Object,​java.lang.String> componentsToRegister  
    protected F endpointFactoryBean  
    protected H handler  

    Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    PARSER, target

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected EndpointSpec​(H handler)  
  • Method Summary

    Modifier and Type Method Description
    protected void assertHandler()  
    abstract S autoStartup​(boolean autoStartup)  
    protected reactor.util.function.Tuple2<F,​H> doGet()  
    java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()  
    S id​(java.lang.String id)
    Configure the component identifier.
    protected org.springframework.messaging.MessageChannel obtainInputChannelFromFlow​(IntegrationFlow subFlow)
    Try to get a MessageChannel as an input for the provided IntegrationFlow or create one and wrap the provided flow to a new one.
    protected org.springframework.messaging.MessageChannel obtainInputChannelFromFlow​(IntegrationFlow subFlow, boolean evaluateInternalBuilder)
    Try to get a MessageChannel as an input for the provided IntegrationFlow or create one and wrap the provided flow to a new one.
    abstract S phase​(int phase)  
    S poller​(java.util.function.Function<PollerFactory,​PollerSpec> pollers)  
    S poller​(PollerSpec pollerMetadataSpec)  
    abstract S poller​(PollerMetadata pollerMetadata)  
    abstract S role​(java.lang.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • componentsToRegister

      protected final java.util.Map<java.lang.Object,​java.lang.String> componentsToRegister
    • handler

      protected H handler
    • endpointFactoryBean

      protected F extends org.springframework.beans.factory.BeanNameAware endpointFactoryBean
  • Constructor Details

  • Method Details

    • id

      public S id​(java.lang.String id)
      Description copied from class: IntegrationComponentSpec
      Configure the component identifier. Used as the beanName to register the bean in the application context for this component.
      Overrides:
      id in class IntegrationComponentSpec<S extends EndpointSpec<S,​F,​H>,​reactor.util.function.Tuple2<F extends org.springframework.beans.factory.BeanNameAware,​H>>
      Parameters:
      id - the id.
      Returns:
      the spec.
    • poller

      public S poller​(java.util.function.Function<PollerFactory,​PollerSpec> pollers)
      Parameters:
      pollers - the pollers
      Returns:
      the endpoint spec.
      See Also:
      AbstractPollingEndpoint, PollerFactory
    • poller

      public S poller​(PollerSpec pollerMetadataSpec)
      Parameters:
      pollerMetadataSpec - the pollerMetadataSpec
      Returns:
      the endpoint spec.
      See Also:
      AbstractPollingEndpoint, PollerSpec
    • poller

      public abstract S poller​(PollerMetadata pollerMetadata)
      Parameters:
      pollerMetadata - the pollerMetadata
      Returns:
      the endpoint spec.
      See Also:
      AbstractPollingEndpoint
    • phase

      public abstract S phase​(int phase)
      Parameters:
      phase - the phase.
      Returns:
      the endpoint spec.
      See Also:
      SmartLifecycle
    • autoStartup

      public abstract S autoStartup​(boolean autoStartup)
      Parameters:
      autoStartup - the autoStartup.
      Returns:
      the endpoint spec
      See Also:
      SmartLifecycle
    • role

      public abstract S role​(java.lang.String 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

      public java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface ComponentsRegistration
    • doGet

      protected reactor.util.function.Tuple2<F,​H> doGet()
      Overrides:
      doGet in class IntegrationComponentSpec<S extends EndpointSpec<S,​F,​H>,​reactor.util.function.Tuple2<F extends org.springframework.beans.factory.BeanNameAware,​H>>
    • assertHandler

      protected void assertHandler()
    • obtainInputChannelFromFlow

      protected org.springframework.messaging.MessageChannel obtainInputChannelFromFlow​(IntegrationFlow subFlow)
      Try to get a MessageChannel as an input for the provided IntegrationFlow or create one and wrap the provided flow to a new one.
      Parameters:
      subFlow - the IntegrationFlow to extract input channel.
      Returns:
      the input channel of the flow of create one
      Since:
      5.0.4
    • obtainInputChannelFromFlow

      protected org.springframework.messaging.MessageChannel obtainInputChannelFromFlow​(IntegrationFlow subFlow, boolean evaluateInternalBuilder)
      Try to get a MessageChannel as an input for the provided IntegrationFlow or create one and wrap the provided flow to a new one.
      Parameters:
      subFlow - the IntegrationFlow to extract input channel.
      evaluateInternalBuilder - true if an internal IntegrationFlowDefinition should be evaluated to an IntegrationFlow component or left as a builder in the componentsToRegister 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