public abstract class Writer
extends java.lang.Object
implements java.io.Closeable
A transport creates implementation of this class and registers the writer
object using WebSocketEngine.UpgradeInfo.createConnection(org.glassfish.tyrus.spi.Writer, org.glassfish.tyrus.spi.Connection.CloseListener)
after
a successful upgrade.
Constructor and Description |
---|
Writer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
write(java.nio.ByteBuffer buffer,
CompletionHandler<java.nio.ByteBuffer> completionHandler)
A backward compatible method called from
write(ByteBuffer, CompletionHandler, WriterInfo)
to handover the data for a connection
to the transport. |
void |
write(java.nio.ByteBuffer buffer,
CompletionHandler<java.nio.ByteBuffer> completionHandler,
WriterInfo writerInfo)
Tyrus runtime calls this method to handover the data for a connection
to the transport.
|
public abstract void write(java.nio.ByteBuffer buffer, CompletionHandler<java.nio.ByteBuffer> completionHandler)
A backward compatible method called from write(ByteBuffer, CompletionHandler, WriterInfo)
to handover the data for a connection
to the transport. The transport writes bytes to underlying connection.
Tyrus runtime must not use the buffer until the write is completed.
The method will be removed in the next major version.
buffer
- bytes to write.completionHandler
- completion handler to know the write status.public void write(java.nio.ByteBuffer buffer, CompletionHandler<java.nio.ByteBuffer> completionHandler, WriterInfo writerInfo)
buffer
- bytes to write.completionHandler
- completion handler to know the write status.writerInfo
- additional information about the data to be written.Copyright © 2012–2020 Oracle Corporation. All rights reserved.