|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.stream.CharacterStreamWritingMessageHandler
public class CharacterStreamWritingMessageHandler
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 Object.toString()
method will be written. To append a new-line after each write, set the
shouldAppendNewLine
flag to 'true'. It is 'false' by default.
Constructor Summary | |
---|---|
CharacterStreamWritingMessageHandler(Writer writer)
|
|
CharacterStreamWritingMessageHandler(Writer writer,
int bufferSize)
|
Method Summary | |
---|---|
void |
handleMessage(Message<?> message)
Handles the message if possible. |
void |
setShouldAppendNewLine(boolean shouldAppendNewLine)
|
static CharacterStreamWritingMessageHandler |
stderr()
Factory method that creates a target for stderr (System.err) with the default charset encoding. |
static CharacterStreamWritingMessageHandler |
stderr(String charsetName)
Factory method that creates a target for stderr (System.err) with the specified charset encoding. |
static CharacterStreamWritingMessageHandler |
stdout()
Factory method that creates a target for stdout (System.out) with the default charset encoding. |
static CharacterStreamWritingMessageHandler |
stdout(String charsetName)
Factory method that creates a target for stdout (System.out) with the specified charset encoding. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CharacterStreamWritingMessageHandler(Writer writer)
public CharacterStreamWritingMessageHandler(Writer writer, int bufferSize)
Method Detail |
---|
public static CharacterStreamWritingMessageHandler stdout()
public static CharacterStreamWritingMessageHandler stdout(String charsetName)
public static CharacterStreamWritingMessageHandler stderr()
public static CharacterStreamWritingMessageHandler stderr(String charsetName)
public void setShouldAppendNewLine(boolean shouldAppendNewLine)
public void handleMessage(Message<?> message)
MessageHandler
MessageRejectedException
e.g.
in case of a Selective Consumer. When a consumer tries to handle a
message, but fails to do so, a MessageHandlingException
is
thrown. In the last case it is recommended to treat the message as tainted
and go into an error scenario.
When the handling results in a message being sent failure to send that
message will result in a MessageDeliveryException
.
handleMessage
in interface MessageHandler
message
- the message to be handled
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |