Interface Binding<T>

Type Parameters:
T - type of binding
All Superinterfaces:
org.springframework.context.Lifecycle, org.springframework.integration.support.management.ManageableLifecycle, org.springframework.integration.core.Pausable
All Known Implementing Classes:
BindingService.LateBinding, DefaultBinding

public interface Binding<T> extends org.springframework.integration.core.Pausable
Represents a binding between an input or output and an adapter endpoint that connects via a Binder. The binding could be for a consumer or a producer. A consumer binding represents a connection from an adapter to an input. A producer binding represents a connection from an output to an adapter.
Author:
Jennifer Hickey, Mark Fisher, Gary Russell, Marius Bogoevici, Oleg Zhurakousky
  • Method Summary

    Modifier and Type
    Method
    Description
    default Map<String,Object>
    Will return additional configuration properties associated with this binding.
    default String
    Returns the name of the binder for this binding.
    default String
    Returns the type of the binder for this binding.
    default String
    Returns the name of the target for this binding (i.e., channel name).
    default Map<String,Object>
     
    default <P> P
    Will return producer or consumer properties of this binding.
    default String
    Returns the name of the destination for this binding.
    default boolean
    Returns boolean flag representing this binding's type.
    default boolean
    Will always return false unless overriden.
    default boolean
     
    default void
    Pauses the target component represented by this instance if and only if the component implements Pausable interface NOTE: At the time the instance is created the component is already started and active.
    default void
    Resumes the target component represented by this instance if and only if the component implements Pausable interface NOTE: At the time the instance is created the component is already started and active.
    default void
    Starts the target component represented by this instance.
    default void
    Stops the target component represented by this instance.
    void
    Unbinds the target component represented by this instance and stops any active components.
  • Method Details

    • getExtendedInfo

      default Map<String,Object> getExtendedInfo()
    • getExtension

      default <P> P getExtension()
      Will return producer or consumer properties of this binding.
      Type Parameters:
      P - type of producer or consumer properties
      Returns:
      producer or consumer properties of this binding
    • getAdditionalConfigurationProperties

      default Map<String,Object> getAdditionalConfigurationProperties()
      Will return additional configuration properties associated with this binding. Must be implemented by individual binders and is primarily designed for testing and debugging/diagnosing issues.
      Returns:
      additional configuration properties associated with this binding.
    • start

      default void start()
      Starts the target component represented by this instance. NOTE: At the time the instance is created the component is already started. This operation is typically used by actuator to re-bind/re-start.
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Specified by:
      start in interface org.springframework.integration.support.management.ManageableLifecycle
      See Also:
    • stop

      default void stop()
      Stops the target component represented by this instance. NOTE: At the time the instance is created the component is already started. This operation is typically used by actuator to re-bind/re-start.
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Specified by:
      stop in interface org.springframework.integration.support.management.ManageableLifecycle
      See Also:
    • isPaused

      default boolean isPaused()
      Will always return false unless overriden.
      Specified by:
      isPaused in interface org.springframework.integration.core.Pausable
    • pause

      default void pause()
      Pauses the target component represented by this instance if and only if the component implements Pausable interface NOTE: At the time the instance is created the component is already started and active. This operation is typically used by actuator to pause/resume.
      Specified by:
      pause in interface org.springframework.integration.core.Pausable
      See Also:
    • resume

      default void resume()
      Resumes the target component represented by this instance if and only if the component implements Pausable interface NOTE: At the time the instance is created the component is already started and active. This operation is typically used by actuator to pause/resume.
      Specified by:
      resume in interface org.springframework.integration.core.Pausable
      See Also:
    • isRunning

      default boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
      Specified by:
      isRunning in interface org.springframework.integration.support.management.ManageableLifecycle
      Returns:
      'true' if the target component represented by this instance is running.
    • getName

      default String getName()
      Returns the name of the destination for this binding.
      Returns:
      destination name
    • getBindingName

      default String getBindingName()
      Returns the name of the target for this binding (i.e., channel name).
      Returns:
      binding name
      Since:
      2.2
    • getBinderName

      default String getBinderName()
      Returns the name of the binder for this binding.
      Returns:
      binder name
      Since:
      4.0.2
    • getBinderType

      default String getBinderType()
      Returns the type of the binder for this binding.
      Returns:
      binder name
      Since:
      4.0.2
    • unbind

      void unbind()
      Unbinds the target component represented by this instance and stops any active components. Implementations must be idempotent. After this method is invoked, the target is not expected to receive any messages; this instance should be discarded, and a new Binding should be created instead.
    • isInput

      default boolean isInput()
      Returns boolean flag representing this binding's type. If 'true' this binding is an 'input' binding otherwise it is 'output' (as in binding annotated with either @Input or @Output).
      Returns:
      'true' if this binding represents an input binding.