|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.tyrus.RemoteEndpointWrapper
public final class RemoteEndpointWrapper
Wrapps the RemoteEndpoint and represents the other side of the websocket connection.
| Method Summary | |
|---|---|
void |
close(CloseReason cr)
|
OutputStream |
getSendStream()
Opens an output stream on which a binary message may be sent. |
Writer |
getSendWriter()
Opens an character stream on which a text message may be sent. |
Session |
getSession()
|
void |
sendBytes(ByteBuffer data)
Send a binary message, returning when all of the message has been transmitted. |
void |
sendBytesByCompletion(ByteBuffer byteBuffer,
SendHandler sendHandler)
Initiates the asynchronous transmission of a binary message. |
Future<SendResult> |
sendBytesByFuture(ByteBuffer byteBuffer)
Initiates the asynchronous transmission of a binary message. |
void |
sendObject(Object o)
Sends a custom developer object, blocking until it has been transmitted. |
void |
sendObjectByCompletion(Object t,
SendHandler sendHandler)
Initiates the asynchronous transmission of a custom developer object. |
Future<SendResult> |
sendObjectByFuture(Object t)
Initiates the asynchronous transmission of a custom developer object. |
void |
sendPartialBytes(ByteBuffer byteBuffer,
boolean isLast)
Send a binary message in pieces, blocking until all of the message has been transmitted. |
void |
sendPartialString(String fragment,
boolean isLast)
Send a text message in pieces, blocking until all of the message has been transmitted. |
void |
sendPing(ByteBuffer applicationData)
Send a Ping message containing the given application data to the remote endpoint. |
void |
sendPong(ByteBuffer applicationData)
Allows the developer to send an unsolicited Pong message containing the given application data in order to serve as a unidirectional heartbeat for the session. |
void |
sendString(String data)
Send a text message, blocking until all of the message has been transmitted. |
void |
sendStringByCompletion(String s,
SendHandler sendHandler)
Initiates the asynchronous transmission of a text message. |
Future<SendResult> |
sendStringByFuture(String s)
Initiates the asynchronous transmission of a text message. |
String |
toString()
|
void |
updateLastConnectionActivity()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void sendString(String data)
throws IOException
RemoteEndpoint
sendString in interface RemoteEndpointdata - the message to be sent.
IOException
public void sendBytes(ByteBuffer data)
throws IOException
RemoteEndpoint
sendBytes in interface RemoteEndpointdata - the message to be sent.
IOException
public void sendPartialString(String fragment,
boolean isLast)
throws IOException
RemoteEndpoint
sendPartialString in interface RemoteEndpointfragment - the piece of the message being sent.isLast - Whether the fragment being sent is the last piece of the message.
IOException
public void sendPartialBytes(ByteBuffer byteBuffer,
boolean isLast)
throws IOException
RemoteEndpoint
sendPartialBytes in interface RemoteEndpointbyteBuffer - the piece of the message being sent.isLast - Whether the fragment being sent is the last piece of the message.
IOException
public OutputStream getSendStream()
throws IOException
RemoteEndpoint
getSendStream in interface RemoteEndpointIOException
public Writer getSendWriter()
throws IOException
RemoteEndpoint
getSendWriter in interface RemoteEndpointIOException
public void sendObject(Object o)
throws IOException,
EncodeException
RemoteEndpoint
sendObject in interface RemoteEndpointo - the object to be sent.
IOException
EncodeException
public void sendStringByCompletion(String s,
SendHandler sendHandler)
RemoteEndpoint
sendStringByCompletion in interface RemoteEndpoints - the text being sent.sendHandler - the handler which will be notified of progress.public Future<SendResult> sendStringByFuture(String s)
RemoteEndpoint
sendStringByFuture in interface RemoteEndpoints - the text being sent.
public Future<SendResult> sendBytesByFuture(ByteBuffer byteBuffer)
RemoteEndpoint
sendBytesByFuture in interface RemoteEndpointbyteBuffer - the data being sent.
public void sendBytesByCompletion(ByteBuffer byteBuffer,
SendHandler sendHandler)
RemoteEndpoint
sendBytesByCompletion in interface RemoteEndpointbyteBuffer - the data being sent.sendHandler - the handler that will be notified of progress.public Future<SendResult> sendObjectByFuture(Object t)
RemoteEndpoint
sendObjectByFuture in interface RemoteEndpointt - the object being sent.
public void sendObjectByCompletion(Object t,
SendHandler sendHandler)
RemoteEndpoint
sendObjectByCompletion in interface RemoteEndpointt - the object being sent.sendHandler - the handler that will be notified of progresspublic void sendPing(ByteBuffer applicationData)
RemoteEndpoint
sendPing in interface RemoteEndpointapplicationData - the data to be carried in the ping request.public void sendPong(ByteBuffer applicationData)
RemoteEndpoint
sendPong in interface RemoteEndpointapplicationData - the application data to be carried in the pong response.public String toString()
toString in class Object
public void close(CloseReason cr)
throws IOException
IOExceptionpublic Session getSession()
public void updateLastConnectionActivity()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||