public abstract class WsRemoteEndpointImplBase extends Object implements RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic| Modifier and Type | Field and Description |
|---|---|
static String |
BLOCKING_SEND_TIMEOUT_PROPERTY |
| Constructor and Description |
|---|
WsRemoteEndpointImplBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract void |
doClose() |
protected abstract void |
doWrite(SendHandler handler,
ByteBuffer... data) |
void |
flushBatch()
Flush any currently batched messages to the remote endpoint.
|
boolean |
getBatchingAllowed()
Obtains the current batching status of the endpoint.
|
OutputStream |
getSendStream() |
long |
getSendTimeout() |
Writer |
getSendWriter() |
protected abstract boolean |
isMasked() |
void |
sendBytes(ByteBuffer data) |
void |
sendBytesByCompletion(ByteBuffer data,
SendHandler handler) |
Future<Void> |
sendBytesByFuture(ByteBuffer data) |
void |
sendObject(Object obj) |
void |
sendObjectByCompletion(Object obj,
SendHandler completion) |
Future<Void> |
sendObjectByFuture(Object obj) |
void |
sendPartialBytes(ByteBuffer partialByte,
boolean last) |
void |
sendPartialString(String fragment,
boolean isLast) |
void |
sendPing(ByteBuffer applicationData)
Send a ping message blocking until the message has been sent.
|
void |
sendPong(ByteBuffer applicationData)
Send a pong message blocking until the message has been sent.
|
void |
sendString(String text) |
void |
sendStringByCompletion(String text,
SendHandler handler) |
Future<Void> |
sendStringByFuture(String text) |
void |
setBatchingAllowed(boolean batchingAllowed)
Enable or disable the batching of outgoing messages for this endpoint.
|
protected void |
setEncoders(EndpointConfig endpointConfig) |
void |
setSendTimeout(long timeout) |
protected void |
setSession(WsSession wsSession) |
protected void |
setTransformation(Transformation transformation) |
public static final String BLOCKING_SEND_TIMEOUT_PROPERTY
protected void setTransformation(Transformation transformation)
public long getSendTimeout()
public void setSendTimeout(long timeout)
public void setBatchingAllowed(boolean batchingAllowed)
throws IOException
RemoteEndpointsetBatchingAllowed in interface RemoteEndpointbatchingAllowed - New settingIOException - If changing the value resulted in a call to
RemoteEndpoint.flushBatch() and that call threw an
IOException.public boolean getBatchingAllowed()
RemoteEndpointgetBatchingAllowed in interface RemoteEndpointtrue if batching is enabled, otherwise
false.public void flushBatch()
throws IOException
RemoteEndpointflushBatch in interface RemoteEndpointIOException - If an I/O error occurs while flushingpublic void sendBytes(ByteBuffer data) throws IOException
IOExceptionpublic Future<Void> sendBytesByFuture(ByteBuffer data)
public void sendBytesByCompletion(ByteBuffer data, SendHandler handler)
public void sendPartialBytes(ByteBuffer partialByte, boolean last) throws IOException
IOExceptionpublic void sendPing(ByteBuffer applicationData) throws IOException, IllegalArgumentException
RemoteEndpointsendPing in interface RemoteEndpointapplicationData - The payload for the ping messageIOException - If an I/O error occurs while sending the pingIllegalArgumentException - if the applicationData is too large for
a control message (max 125 bytes)public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException
RemoteEndpointsendPong in interface RemoteEndpointapplicationData - The payload for the pong messageIOException - If an I/O error occurs while sending the pongIllegalArgumentException - if the applicationData is too large for
a control message (max 125 bytes)public void sendString(String text) throws IOException
IOExceptionpublic void sendStringByCompletion(String text, SendHandler handler)
public void sendPartialString(String fragment, boolean isLast) throws IOException
IOExceptionpublic OutputStream getSendStream()
public Writer getSendWriter()
public void sendObject(Object obj) throws IOException, EncodeException
IOExceptionEncodeExceptionpublic void sendObjectByCompletion(Object obj, SendHandler completion)
protected void setSession(WsSession wsSession)
protected void setEncoders(EndpointConfig endpointConfig) throws DeploymentException
DeploymentExceptionpublic final void close()
protected abstract void doWrite(SendHandler handler, ByteBuffer... data)
protected abstract boolean isMasked()
protected abstract void doClose()
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.