public class ContentTranslatorSender extends Object implements ConditionalSender
ContentTranslator
to transform the
message content. Once the content has been updated, then this sender
delegates to a real implementation the sending of the message.ContentTranslator
Constructor and Description |
---|
ContentTranslatorSender(ContentTranslator translator,
MessageSender delegate)
Initialize the sender with the provided translator and decorated sender.
|
Modifier and Type | Method and Description |
---|---|
void |
send(Message message)
Sends the message.
|
boolean |
supports(Message message)
Indicates if the implementation is able to handle the provided message.
|
String |
toString() |
public ContentTranslatorSender(ContentTranslator translator, MessageSender delegate)
translator
- the translator implementation that will transform the content
of the messagedelegate
- The decorated sender will really send the messagepublic boolean supports(Message message)
ConditionalSender
supports
in interface ConditionalSender
message
- the message to check if it can be sent using this senderpublic void send(Message message) throws MessageException
MessageSender
send
in interface MessageSender
message
- the message to sendMessageException
- when the message couldn't be sentCopyright © 2017. All rights reserved.