Class ExpressionEvaluatingSplitter

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, Ordered, ExpressionCapable, Orderable, MessageProducer, DiscardingMessageHandler, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, ManageableLifecycle, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class ExpressionEvaluatingSplitter extends AbstractMessageSplitter
A Message Splitter implementation that evaluates the specified SpEL expression. The result of evaluation will typically be a Collection or Array. If the result is not a Collection or Array, then the single Object will be returned as the payload of a single reply Message.
Since:
2.0
Author:
Mark Fisher, Gary Russell
  • Constructor Details

    • ExpressionEvaluatingSplitter

      public ExpressionEvaluatingSplitter(Expression expression)
  • Method Details

    • doInit

      protected void doInit()
      Overrides:
      doInit in class AbstractMessageSplitter
    • splitMessage

      protected final Object splitMessage(Message<?> message)
      Description copied from class: AbstractMessageSplitter
      Subclasses must override this method to split the received Message. The return value may be a Collection or Array. The individual elements may be Messages, but it is not necessary. If the elements are not Messages, each will be provided as the payload of a Message. It is also acceptable to return a single Object or Message. In that case, a single reply Message will be produced.
      Specified by:
      splitMessage in class AbstractMessageSplitter
      Parameters:
      message - The message.
      Returns:
      The result of splitting the message.
    • start

      public void start()
      Specified by:
      start in interface Lifecycle
      Specified by:
      start in interface ManageableLifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface Lifecycle
      Specified by:
      stop in interface ManageableLifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface Lifecycle
      Specified by:
      isRunning in interface ManageableLifecycle