|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.tyrus.RemoteEndpointWrapper<T>
public final class RemoteEndpointWrapper<T>
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. |
Future<SendResult> |
sendBytes(ByteBuffer data,
SendHandler completion)
Initiates the asynchronous transmission of a binary message. |
void |
sendObject(T o)
Sends a custom developer object, blocking until it has been transmitted. |
Future<SendResult> |
sendObject(T o,
SendHandler completion)
Initiates the 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. |
Future<SendResult> |
sendString(String text,
SendHandler completion)
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 RemoteEndpoint<T>data - the message to be sent.
IOException
public void sendBytes(ByteBuffer data)
throws IOException
RemoteEndpoint
sendBytes in interface RemoteEndpoint<T>data - the message to be sent.
IOException
public void sendPartialString(String fragment,
boolean isLast)
throws IOException
RemoteEndpoint
sendPartialString in interface RemoteEndpoint<T>fragment - the piece of the message being sent.
IOException
public void sendPartialBytes(ByteBuffer byteBuffer,
boolean isLast)
throws IOException
RemoteEndpoint
sendPartialBytes in interface RemoteEndpoint<T>byteBuffer - the piece of the message being sent.
IOException
public OutputStream getSendStream()
throws IOException
RemoteEndpoint
getSendStream in interface RemoteEndpoint<T>IOException
public Writer getSendWriter()
throws IOException
RemoteEndpoint
getSendWriter in interface RemoteEndpoint<T>IOException
public void sendObject(T o)
throws IOException,
EncodeException
RemoteEndpoint
sendObject in interface RemoteEndpoint<T>o - the object to be sent.
IOException
EncodeException
public Future<SendResult> sendString(String text,
SendHandler completion)
RemoteEndpoint
sendString in interface RemoteEndpoint<T>text - the text being sent.completion - the handler which will be notified of progress.
public Future<SendResult> sendBytes(ByteBuffer data,
SendHandler completion)
RemoteEndpoint
sendBytes in interface RemoteEndpoint<T>data - the data being sent.completion - the handler that will be notified of progress.
public Future<SendResult> sendObject(T o,
SendHandler completion)
RemoteEndpoint
sendObject in interface RemoteEndpoint<T>o - the object being sent.
public void sendPing(ByteBuffer applicationData)
RemoteEndpoint
sendPing in interface RemoteEndpoint<T>applicationData - the data to be carried in the ping request.public void sendPong(ByteBuffer applicationData)
RemoteEndpoint
sendPong in interface RemoteEndpoint<T>applicationData - 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 | |||||||||