Class MessageInterceptorRegistration

  • All Implemented Interfaces:
    org.springframework.core.Ordered

    public class MessageInterceptorRegistration
    extends java.lang.Object
    implements org.springframework.core.Ordered
    Information about the channels that should be intercepted by a MessageInterceptor.
    • Constructor Detail

      • MessageInterceptorRegistration

        public MessageInterceptorRegistration​(java.util.regex.Pattern channelNamePattern,
                                              MessageInterceptor interceptor,
                                              java.util.Set<EndpointType> enabledEndpointTypes,
                                              int order)
    • Method Detail

      • allChannelsWith

        public static MessageInterceptorRegistration allChannelsWith​(@Nonnull
                                                                     MessageInterceptor interceptor,
                                                                     int order)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor in all channels, at the sender-side as well as at the receiver-side.
        Parameters:
        interceptor - the MessageInterceptor used to intercept messages
        order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
        Returns:
        MessageInterceptorRegistration
      • matchingChannelsWith

        public static MessageInterceptorRegistration matchingChannelsWith​(@Nonnull
                                                                          java.lang.String channelNamePattern,
                                                                          @Nonnull
                                                                          MessageInterceptor interceptor)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor in all channels with names matching the channelNamePattern, at the sender-side as well as at the receiver-side.
        Parameters:
        channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
        interceptor - the MessageInterceptor used to intercept messages
        Returns:
        MessageInterceptorRegistration
      • matchingChannelsWith

        public static MessageInterceptorRegistration matchingChannelsWith​(@Nonnull
                                                                          java.lang.String channelNamePattern,
                                                                          @Nonnull
                                                                          MessageInterceptor interceptor,
                                                                          int order)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor in all channels with names matching the channelNamePattern, at the sender-side as well as at the receiver-side.
        Parameters:
        channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
        interceptor - the MessageInterceptor used to intercept messages
        order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
        Returns:
        MessageInterceptorRegistration
      • receiverChannelsWith

        public static MessageInterceptorRegistration receiverChannelsWith​(@Nonnull
                                                                          MessageInterceptor interceptor,
                                                                          int order)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the receiver-side of all channels.
        Parameters:
        interceptor - the MessageInterceptor used to intercept messages
        order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
        Returns:
        MessageInterceptorRegistration
      • matchingReceiverChannelsWith

        public static MessageInterceptorRegistration matchingReceiverChannelsWith​(@Nonnull
                                                                                  java.lang.String channelNamePattern,
                                                                                  @Nonnull
                                                                                  MessageInterceptor interceptor)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the receiver-side of all channels with names matching the channelNamePattern.
        Parameters:
        channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
        interceptor - the MessageInterceptor used to intercept messages
        Returns:
        MessageInterceptorRegistration
      • matchingReceiverChannelsWith

        public static MessageInterceptorRegistration matchingReceiverChannelsWith​(@Nonnull
                                                                                  java.lang.String channelNamePattern,
                                                                                  @Nonnull
                                                                                  MessageInterceptor interceptor,
                                                                                  int order)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the receiver-side of all channels with names matching the channelNamePattern.
        Parameters:
        channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
        interceptor - the MessageInterceptor used to intercept messages
        order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
        Returns:
        MessageInterceptorRegistration
      • senderChannelsWith

        public static MessageInterceptorRegistration senderChannelsWith​(@Nonnull
                                                                        MessageInterceptor interceptor,
                                                                        int order)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the sender-side of all channels.
        Parameters:
        interceptor - the MessageInterceptor used to intercept messages
        order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
        Returns:
        MessageInterceptorRegistration
      • matchingSenderChannelsWith

        public static MessageInterceptorRegistration matchingSenderChannelsWith​(@Nonnull
                                                                                java.lang.String channelNamePattern,
                                                                                @Nonnull
                                                                                MessageInterceptor interceptor)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the sender-side of all channels with names matching the channelNamePattern.
        Parameters:
        channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
        interceptor - the MessageInterceptor used to intercept messages
        Returns:
        MessageInterceptorRegistration
      • matchingSenderChannelsWith

        public static MessageInterceptorRegistration matchingSenderChannelsWith​(@Nonnull
                                                                                java.lang.String channelNamePattern,
                                                                                @Nonnull
                                                                                MessageInterceptor interceptor,
                                                                                int order)
        Creates a MessageInterceptorRegistration that is used to register a MessageInterceptor at the sender-side of all channels with names matching the channelNamePattern.
        Parameters:
        channelNamePattern - the regexp used to match channel names. Only channels with matching names will be intercepted.
        interceptor - the MessageInterceptor used to intercept messages
        order - the order of the interceptor. Highest precedence interceptors (lowest order value) will be executed last.
        Returns:
        MessageInterceptorRegistration
      • getInterceptor

        public MessageInterceptor getInterceptor()
        Returns the MessageInterceptor of the registration.
        Returns:
        MessageInterceptor
      • isEnabledFor

        public boolean isEnabledFor​(java.lang.String channelNamePattern,
                                    EndpointType endpointType)
        Returns true if the registration is matching the given channelName and EndpointType, false otherwise.
        Parameters:
        channelNamePattern - the regexp used to match channel names
        endpointType - the EndpointType of the channel
        Returns:
        boolean
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object