Top Description Methods
org.glassfish.grizzly.asyncqueue

public Interface MessageCloner<E>

Known Direct Implementers
org.glassfish.grizzly.ssl.SSLBaseFilter.OnWriteCopyCloner
Imports
org.glassfish.grizzly.Connection

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 TypeMethod and Description
public E

Returns:

original org.glassfish.grizzly.Buffer or its clone to be added to asynchronous queue.
clone
(Connection<L>
Connection, where the org.glassfish.grizzly.Buffer will be written.
connection
,
E originalMessage)

Method will be called by AsyncQueueWriter, when message could not be written directly, and will be added to the queue.

Method Detail

cloneback to summary
public E clone(Connection<L> connection, E originalMessage)

Method 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.

Parameters
connection:Connection<L>

Connection, where the org.glassfish.grizzly.Buffer will be written.

originalMessage:E

org.glassfish.grizzly.Buffer to be written.

Returns:E

original org.glassfish.grizzly.Buffer or its clone to be added to asynchronous queue.