Top Fields Constructors Methods
org.eclipse.jetty.ee10.websocket.jakarta.common

public Class JakartaWebSocketAsyncRemote

extends JakartaWebSocketRemoteEndpoint
implements Async
Class Inheritance
All Implemented Interfaces
jakarta.websocket.RemoteEndpoint.Async, jakarta.websocket.RemoteEndpoint
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.concurrent.Future, jakarta.websocket.EncodeException, .Encoder, .SendHandler, .SendResult, org.eclipse.jetty.util.BufferUtil, .FutureCallback, org.eclipse.jetty.websocket.core.CoreSession, .Frame, .OpCode, org.eclipse.jetty.websocket.core.messages.MessageOutputStream, .MessageWriter, org.eclipse.jetty.websocket.core.util.TextUtils, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
pack-priv static final Logger
Inherited from org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketRemoteEndpoint:
batchmessageTypesession

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public long
getSendTimeout()

Implements jakarta.websocket.RemoteEndpoint.Async.getSendTimeout.

Return the number of milliseconds the implementation will timeout attempting to send a websocket message.

public Future<Void>
sendBinary(ByteBuffer
the data being sent.
data
)

Implements jakarta.websocket.RemoteEndpoint.Async.sendBinary.

Initiates the asynchronous transmission of a binary message.

public void
sendBinary(ByteBuffer
the data being sent, must not be null.
data
,
SendHandler
the handler that will be notified of progress, must not be null.
handler
)

Implements jakarta.websocket.RemoteEndpoint.Async.sendBinary.

Initiates the asynchronous transmission of a binary message.

public Future<Void>
sendObject(Object
the object being sent.
data
)

Implements jakarta.websocket.RemoteEndpoint.Async.sendObject.

Initiates the asynchronous transmission of a custom developer object.

public void
sendObject(Object
the object being sent.
data
,
SendHandler
the handler that will be notified of progress, must not be null.
handler
)

Implements jakarta.websocket.RemoteEndpoint.Async.sendObject.

Initiates the asynchronous transmission of a custom developer object.

public Future<Void>
sendText(String
the text being sent.
text
)

Implements jakarta.websocket.RemoteEndpoint.Async.sendText.

Initiates the asynchronous transmission of a text message.

public void
sendText(String
the text being sent.
text
,
SendHandler
the handler which will be notified of progress.
handler
)

Implements jakarta.websocket.RemoteEndpoint.Async.sendText.

Initiates the asynchronous transmission of a text message.

public void
setSendTimeout(long
The number of milliseconds this RemoteEndpoint will wait before timing out an incomplete asynchronous message send.
timeoutmillis
)

Implements jakarta.websocket.RemoteEndpoint.Async.setSendTimeout.

Sets the number of milliseconds the implementation will timeout attempting to send a websocket message.

Inherited from org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketRemoteEndpoint:
assertMessageNotNullassertSendHandlerNotNullflushBatchgetBatchingAllowedgetIdleTimeoutgetWriteTimeoutnewMessageOutputStreamnewMessageWritersendFramesendObjectsendPingsendPongsetBatchingAllowedsetIdleTimeoutsetWriteTimeout

Field Detail

LOGback to summary
pack-priv static final Logger LOG

Hides org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketRemoteEndpoint.LOG.

Constructor Detail

JakartaWebSocketAsyncRemoteback to summary
protected JakartaWebSocketAsyncRemote(JakartaWebSocketSession session, CoreSession coreSession)

Method Detail

getSendTimeoutback to summary
public long getSendTimeout()

Implements jakarta.websocket.RemoteEndpoint.Async.getSendTimeout.

Doc from jakarta.websocket.RemoteEndpoint.Async.getSendTimeout.

Return the number of milliseconds the implementation will timeout attempting to send a websocket message. A zero or negative value indicates the implementation will not timeout attempting to send a websocket message asynchronously. This value overrides the default value assigned in the WebSocketContainer.

Returns:long

the timeout time in milliseconds.

Annotations
@Override
sendBinaryback to summary
public Future<Void> sendBinary(ByteBuffer data)

Implements jakarta.websocket.RemoteEndpoint.Async.sendBinary.

Doc from jakarta.websocket.RemoteEndpoint.Async.sendBinary.

Initiates the asynchronous transmission of a binary message. This method returns before the message is transmitted. Developers use the returned Future object to track progress of the transmission. The Future's get() method returns null upon successful completion. Errors in transmission are wrapped in the java.util.concurrent.ExecutionException thrown when querying the Future object.

It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the message does not complete successfully, the state of the buffer is undefined.

Parameters
data:ByteBuffer

the data being sent.

Returns:Future<Void>

the Future object representing the send operation.

Annotations
@Override
sendBinaryback to summary
public void sendBinary(ByteBuffer data, SendHandler handler)

Implements jakarta.websocket.RemoteEndpoint.Async.sendBinary.

Doc from jakarta.websocket.RemoteEndpoint.Async.sendBinary.

Initiates the asynchronous transmission of a binary message. This method returns before the message is transmitted. Developers provide a callback to be notified when the message has been transmitted. Errors in transmission are given to the developer in the SendResult object.

It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the message does not complete successfully, the state of the buffer is undefined.

Parameters
data:ByteBuffer

the data being sent, must not be null.

handler:SendHandler

the handler that will be notified of progress, must not be null.

Annotations
@Override
sendObjectback to summary
public Future<Void> sendObject(Object data)

Implements jakarta.websocket.RemoteEndpoint.Async.sendObject.

Doc from jakarta.websocket.RemoteEndpoint.Async.sendObject.

Initiates the asynchronous transmission of a custom developer object. The developer will have provided an encoder for this object type in the endpoint configuration. Containers will by default be able to encode java primitive types and their object equivalents, otherwise the developer must have provided an encoder for the object type in the endpoint configuration. A developer-provided encoder for a Java primitive type and its object equivalent overrides the container default encoder. Progress may be tracked using the Future object. The Future's get() methods return null upon successful completion. Errors in transmission are wrapped in the java.util.concurrent.ExecutionException thrown when querying the Future object.

Parameters
data:Object

the object being sent.

Returns:Future<Void>

the Future object representing the send operation.

Annotations
@Override
sendObjectback to summary
public void sendObject(Object data, SendHandler handler)

Implements jakarta.websocket.RemoteEndpoint.Async.sendObject.

Doc from jakarta.websocket.RemoteEndpoint.Async.sendObject.

Initiates the asynchronous transmission of a custom developer object. Containers will by default be able to encode java primitive types and their object equivalents, otherwise the developer must have provided an encoder for the object type in the endpoint configuration. A developer-provided encoder for a Java primitive type and its object equivalent overrides the container default encoder. Developers are notified when transmission is complete through the supplied callback object.

Parameters
data:Object

the object being sent.

handler:SendHandler

the handler that will be notified of progress, must not be null.

Annotations
@SuppressWarnings:rawtypes, unchecked
@Override
sendTextback to summary
public Future<Void> sendText(String text)

Implements jakarta.websocket.RemoteEndpoint.Async.sendText.

Doc from jakarta.websocket.RemoteEndpoint.Async.sendText.

Initiates the asynchronous transmission of a text message. This method returns before the message is transmitted. Developers use the returned Future object to track progress of the transmission. The Future's get() method returns null upon successful completion. Errors in transmission are wrapped in the java.util.concurrent.ExecutionException thrown when querying the Future object.

Parameters
text:String

the text being sent.

Returns:Future<Void>

the Future object representing the send operation.

Annotations
@Override
sendTextback to summary
public void sendText(String text, SendHandler handler)

Implements jakarta.websocket.RemoteEndpoint.Async.sendText.

Doc from jakarta.websocket.RemoteEndpoint.Async.sendText.

Initiates the asynchronous transmission of a text message. This method returns before the message is transmitted. Developers provide a callback to be notified when the message has been transmitted. Errors in transmission are given to the developer in the SendResult object.

Parameters
text:String

the text being sent.

handler:SendHandler

the handler which will be notified of progress.

Annotations
@Override
setSendTimeoutback to summary
public void setSendTimeout(long timeoutmillis)

Implements jakarta.websocket.RemoteEndpoint.Async.setSendTimeout.

Doc from jakarta.websocket.RemoteEndpoint.Async.setSendTimeout.

Sets the number of milliseconds the implementation will timeout attempting to send a websocket message. A zero or negative value indicates the implementation will not timeout attempting to send a websocket message asynchronously. This value overrides the default value assigned in the WebSocketContainer.

Parameters
timeoutmillis:long

The number of milliseconds this RemoteEndpoint will wait before timing out an incomplete asynchronous message send.

Annotations
@Override