public interface MessageCloner<E>
Cloner, which will be called by
AsyncQueueWriter
, when message could not be written directly, and will be
added to the queue. Cloner may create a clone of original message and return it to the AsyncQueueWriter
instead of original one. Using MessageCloner, developer has a chance to clone a message only in case, when it is
really required.- Author:
- Alexey Stashok
-
Method Summary
Modifier and TypeMethodDescriptionclone
(Connection connection, E originalMessage) Method will be called byAsyncQueueWriter
, when message could not be written directly, and will be added to the queue.
-
Method Details
-
clone
Method will be called byAsyncQueueWriter
, when message could not be written directly, and will be added to the queue. Cloner may create a clone of original message and return it to theAsyncQueueWriter
instead of original one. Using MessageCloner, developer has a chance to clone a message only in case, when it is really required.- Parameters:
connection
-Connection
, where theBuffer
will be written.originalMessage
-Buffer
to be written.- Returns:
- original
Buffer
or its clone to be added to asynchronous queue.
-