Class ExpressionEvaluatingSplitter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.splitter.AbstractMessageSplitter
org.springframework.integration.splitter.ExpressionEvaluatingSplitter
- All Implemented Interfaces:
org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.core.Ordered,ExpressionCapable,Orderable,MessageProducer,DiscardingMessageHandler,HeaderPropagationAware,IntegrationPattern,NamedComponent,IntegrationManagement,ManageableLifecycle,TrackableComponent,org.springframework.messaging.MessageHandler,reactor.core.CoreSubscriber<org.springframework.messaging.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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
AbstractReplyProducingMessageHandler.RequestHandlerNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
messagingTemplateFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME -
Constructor Summary
Constructors Constructor Description ExpressionEvaluatingSplitter(org.springframework.expression.Expression expression) -
Method Summary
Modifier and Type Method Description protected voiddoInit()booleanisRunning()protected java.lang.ObjectsplitMessage(org.springframework.messaging.Message<?> message)Subclasses must override this method to split the received Message.voidstart()voidstop()Methods inherited from class org.springframework.integration.splitter.AbstractMessageSplitter
addHeaders, getComponentType, getDiscardChannel, getIntegrationPatternType, handleRequestMessage, obtainSizeIfPossible, obtainSizeIfPossible, produceOutput, setApplySequence, setDiscardChannel, setDiscardChannelName, shouldCopyRequestHeaders, willAddHeadersMethods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyMethods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldSplitOutput, updateNotPropagatedHeadersMethods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribeMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
ExpressionEvaluatingSplitter
public ExpressionEvaluatingSplitter(org.springframework.expression.Expression expression)
-
-
Method Details
-
doInit
protected void doInit()- Overrides:
doInitin classAbstractMessageSplitter
-
splitMessage
protected final java.lang.Object splitMessage(org.springframework.messaging.Message<?> message)Description copied from class:AbstractMessageSplitterSubclasses 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:
splitMessagein classAbstractMessageSplitter- Parameters:
message- The message.- Returns:
- The result of splitting the message.
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceManageableLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Specified by:
stopin interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle- Specified by:
isRunningin interfaceManageableLifecycle
-