Class CharacterStreamWritingMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.stream.CharacterStreamWritingMessageHandler
- All Implemented Interfaces:
- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Ordered,- ExpressionCapable,- Orderable,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
A 
MessageHandler
 that writes characters to a Writer.
 String, character array, and byte array payloads will be written directly,
 but for other payload types, the result of the object's IntegrationObjectSupport.toString()
 method will be written. To append a new-line after each write, set the
 shouldAppendNewLine flag to 'true'. It is 'false' by default.- Author:
- Mark Fisher, Gary Russell
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionappendNewLine(boolean append) Fluent api forsetShouldAppendNewLine(boolean).Subclasses may implement this method to provide component type information.protected voidhandleMessageInternal(Message<?> message) voidsetShouldAppendNewLine(boolean shouldAppendNewLine) stderr()Factory method that creates a target for stderr (System.err) with the default charset encoding.Factory method that creates a target for stderr (System.err) with the specified charset encoding.stdout()Factory method that creates a target for stdout (System.out) with the default charset encoding.Factory method that creates a target for stdout (System.out) with the specified charset encoding.Methods inherited from class org.springframework.integration.handler.AbstractMessageHandlerhandleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupportbuildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscribercurrentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
CharacterStreamWritingMessageHandler
- 
CharacterStreamWritingMessageHandler
 
- 
- 
Method Details- 
stdoutFactory method that creates a target for stdout (System.out) with the default charset encoding.- Returns:
- A stdout handler with the default charset.
 
- 
stdoutFactory method that creates a target for stdout (System.out) with the specified charset encoding.- Parameters:
- charsetName- The charset name.
- Returns:
- A stdout handler.
 
- 
stderrFactory method that creates a target for stderr (System.err) with the default charset encoding.- Returns:
- A stderr handler with the default charset.
 
- 
stderrFactory method that creates a target for stderr (System.err) with the specified charset encoding.- Parameters:
- charsetName- The charset name.
- Returns:
- A stderr handler.
 
- 
setShouldAppendNewLinepublic void setShouldAppendNewLine(boolean shouldAppendNewLine) 
- 
appendNewLineFluent api forsetShouldAppendNewLine(boolean).- Parameters:
- append- true to append a newline.
- Returns:
- this.
- Since:
- 5.4
 
- 
getComponentTypeDescription copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- MessageHandlerSupport
 
- 
handleMessageInternal- Specified by:
- handleMessageInternalin class- AbstractMessageHandler
 
 
-