public abstract class WsRemoteEndpointImplBase extends java.lang.Object implements RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic
Modifier and Type | Field and Description |
---|---|
static java.lang.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,
java.nio.ByteBuffer... data) |
void |
flushBatch()
Flush any currently batched messages to the remote endpoint.
|
boolean |
getBatchingAllowed()
Obtains the current batching status of the endpoint.
|
java.io.OutputStream |
getSendStream() |
long |
getSendTimeout() |
java.io.Writer |
getSendWriter() |
protected abstract boolean |
isMasked() |
void |
sendBytes(java.nio.ByteBuffer data) |
void |
sendBytesByCompletion(java.nio.ByteBuffer data,
SendHandler handler) |
java.util.concurrent.Future<java.lang.Void> |
sendBytesByFuture(java.nio.ByteBuffer data) |
void |
sendObject(java.lang.Object obj) |
void |
sendObjectByCompletion(java.lang.Object obj,
SendHandler completion) |
java.util.concurrent.Future<java.lang.Void> |
sendObjectByFuture(java.lang.Object obj) |
void |
sendPartialBytes(java.nio.ByteBuffer partialByte,
boolean last) |
void |
sendPartialString(java.lang.String fragment,
boolean isLast) |
void |
sendPing(java.nio.ByteBuffer applicationData)
Send a ping message blocking until the message has been sent.
|
void |
sendPong(java.nio.ByteBuffer applicationData)
Send a pong message blocking until the message has been sent.
|
void |
sendString(java.lang.String text) |
void |
sendStringByCompletion(java.lang.String text,
SendHandler handler) |
java.util.concurrent.Future<java.lang.Void> |
sendStringByFuture(java.lang.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 java.lang.String BLOCKING_SEND_TIMEOUT_PROPERTY
protected void setTransformation(Transformation transformation)
public long getSendTimeout()
public void setSendTimeout(long timeout)
public void setBatchingAllowed(boolean batchingAllowed) throws java.io.IOException
javax.websocket.RemoteEndpoint
setBatchingAllowed
in interface RemoteEndpoint
batchingAllowed
- New settingjava.io.IOException
- 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 java.io.IOException
javax.websocket.RemoteEndpoint
flushBatch
in interface RemoteEndpoint
java.io.IOException
- If an I/O error occurs while flushingpublic void sendBytes(java.nio.ByteBuffer data) throws java.io.IOException
java.io.IOException
public java.util.concurrent.Future<java.lang.Void> sendBytesByFuture(java.nio.ByteBuffer data)
public void sendBytesByCompletion(java.nio.ByteBuffer data, SendHandler handler)
public void sendPartialBytes(java.nio.ByteBuffer partialByte, boolean last) throws java.io.IOException
java.io.IOException
public void sendPing(java.nio.ByteBuffer applicationData) throws java.io.IOException, java.lang.IllegalArgumentException
javax.websocket.RemoteEndpoint
sendPing
in interface RemoteEndpoint
applicationData
- The payload for the ping messagejava.io.IOException
- If an I/O error occurs while sending the pingjava.lang.IllegalArgumentException
- if the applicationData is too large for
a control message (max 125 bytes)public void sendPong(java.nio.ByteBuffer applicationData) throws java.io.IOException, java.lang.IllegalArgumentException
javax.websocket.RemoteEndpoint
sendPong
in interface RemoteEndpoint
applicationData
- The payload for the pong messagejava.io.IOException
- If an I/O error occurs while sending the pongjava.lang.IllegalArgumentException
- if the applicationData is too large for
a control message (max 125 bytes)public void sendString(java.lang.String text) throws java.io.IOException
java.io.IOException
public java.util.concurrent.Future<java.lang.Void> sendStringByFuture(java.lang.String text)
public void sendStringByCompletion(java.lang.String text, SendHandler handler)
public void sendPartialString(java.lang.String fragment, boolean isLast) throws java.io.IOException
java.io.IOException
public java.io.OutputStream getSendStream()
public java.io.Writer getSendWriter()
public void sendObject(java.lang.Object obj) throws java.io.IOException, EncodeException
java.io.IOException
EncodeException
public java.util.concurrent.Future<java.lang.Void> sendObjectByFuture(java.lang.Object obj)
public void sendObjectByCompletion(java.lang.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, java.nio.ByteBuffer... data)
protected abstract boolean isMasked()
protected abstract void doClose()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.