public abstract class WsRemoteEndpointImplBase extends Object implements RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic
Modifier and Type | Field and Description |
---|---|
protected static SendResult |
SENDRESULT_OK |
Constructor and Description |
---|
WsRemoteEndpointImplBase() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract void |
doClose() |
protected abstract void |
doWrite(SendHandler handler,
long blockingWrieTimeoutExpiry,
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) |
protected static final SendResult SENDRESULT_OK
protected void setTransformation(Transformation transformation)
public long getSendTimeout()
public void setSendTimeout(long timeout)
public void setBatchingAllowed(boolean batchingAllowed) throws IOException
javax.websocket.RemoteEndpoint
setBatchingAllowed
in interface RemoteEndpoint
batchingAllowed
- New settingIOException
- If changing the value resulted in a call to
RemoteEndpoint.flushBatch()
and that call threw an
IOException
.public boolean getBatchingAllowed()
javax.websocket.RemoteEndpoint
getBatchingAllowed
in interface RemoteEndpoint
true
if batching is enabled, otherwise
false
.public void flushBatch() throws IOException
javax.websocket.RemoteEndpoint
flushBatch
in interface RemoteEndpoint
IOException
- If an I/O error occurs while flushingpublic void sendBytes(ByteBuffer data) throws IOException
IOException
public Future<Void> sendBytesByFuture(ByteBuffer data)
public void sendBytesByCompletion(ByteBuffer data, SendHandler handler)
public void sendPartialBytes(ByteBuffer partialByte, boolean last) throws IOException
IOException
public void sendPing(ByteBuffer applicationData) throws IOException, IllegalArgumentException
javax.websocket.RemoteEndpoint
sendPing
in interface RemoteEndpoint
applicationData
- 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
javax.websocket.RemoteEndpoint
sendPong
in interface RemoteEndpoint
applicationData
- 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
IOException
public void sendStringByCompletion(String text, SendHandler handler)
public void sendPartialString(String fragment, boolean isLast) throws IOException
IOException
public OutputStream getSendStream()
public Writer getSendWriter()
public void sendObject(Object obj) throws IOException, EncodeException
IOException
EncodeException
public void sendObjectByCompletion(Object obj, SendHandler completion)
protected void setSession(WsSession wsSession)
protected void setEncoders(EndpointConfig endpointConfig) throws DeploymentException
DeploymentException
public final void close()
protected abstract void doWrite(SendHandler handler, long blockingWrieTimeoutExpiry, ByteBuffer... data)
protected abstract boolean isMasked()
protected abstract void doClose()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.