Interface HeaderChannelRegistry

All Known Implementing Classes:
DefaultHeaderChannelRegistry

public interface HeaderChannelRegistry
Implementations convert a channel to a name, retaining a reference to the channel keyed by the name. Allows a downstream BeanFactoryChannelResolver to find the channel by name in the event that the flow serialized the message at some point.
Since:
3.0
  • Method Summary

    Modifier and Type Method Description
    org.springframework.messaging.MessageChannel channelNameToChannel​(java.lang.String name)
    Converts the channel name back to a MessageChannel (if it is registered).
    java.lang.Object channelToChannelName​(java.lang.Object channel)
    Converts the channel to a name (String).
    java.lang.Object channelToChannelName​(java.lang.Object channel, long timeToLive)
    Converts the channel to a name (String).
    void runReaper()
    Cancel the scheduled reap task and run immediately; then reschedule.
    int size()  
  • Method Details

    • channelToChannelName

      java.lang.Object channelToChannelName​(java.lang.Object channel)
      Converts the channel to a name (String). If the channel is not a MessageChannel, it is returned unchanged.
      Parameters:
      channel - The channel.
      Returns:
      The channel name, or the channel if it is not a MessageChannel.
    • channelToChannelName

      java.lang.Object channelToChannelName​(java.lang.Object channel, long timeToLive)
      Converts the channel to a name (String). If the channel is not a MessageChannel, it is returned unchanged.
      Parameters:
      channel - The channel.
      timeToLive - How long (ms) at a minimum, the channel mapping should remain in the registry.
      Returns:
      The channel name, or the channel if it is not a MessageChannel.
      Since:
      4.1
    • channelNameToChannel

      org.springframework.messaging.MessageChannel channelNameToChannel​(java.lang.String name)
      Converts the channel name back to a MessageChannel (if it is registered).
      Parameters:
      name - The name of the channel.
      Returns:
      The channel, or null if there is no channel registered with the name.
    • size

      @ManagedAttribute int size()
      Returns:
      the current size of the registry
    • runReaper

      @ManagedOperation(description="Cancel the scheduled reap task and run immediately; then reschedule.") void runReaper()
      Cancel the scheduled reap task and run immediately; then reschedule.