|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.tyrus.spi.SPIEndpoint
org.glassfish.tyrus.EndpointWrapper
public class EndpointWrapper
Wraps the registered application class.
There is one EndpointWrapper for each application class, which handles all the methods.
| Constructor Summary | |
|---|---|
EndpointWrapper(Endpoint endpoint,
EndpointConfiguration configuration,
ClientContainer container,
String contextPath)
|
|
| Method Summary | |
|---|---|
boolean |
checkHandshake(SPIHandshakeRequest hr)
This method must be called by the provider during its check for a successful websocket handshake. |
Object |
decodeCompleteMessage(Object message,
Class<?> type,
boolean isString)
|
List<String> |
getNegotiatedExtensions(List<String> clientExtensions)
Get the negotiated extensions' names based on the extensions supported by client. |
String |
getNegotiatedProtocol(List<String> clientProtocols)
Compute the sub - protocol which will be used. |
void |
onClose(RemoteEndpoint gs)
Called by the provider when the web socket connection to the given remote endpoint has just closed. |
void |
onConnect(RemoteEndpoint gs,
String subprotocol,
List<String> extensions)
Called by the provider when the web socket connection is established. |
void |
onMessage(RemoteEndpoint gs,
ByteBuffer messageBytes)
Called by the provider when the web socket connection has an incoming binary message from the given remote endpoint. |
void |
onMessage(RemoteEndpoint gs,
String messageString)
Called by the provider when the web socket connection has an incoming text message from the given remote endpoint. |
void |
onPartialMessage(RemoteEndpoint gs,
ByteBuffer partialBytes,
boolean last)
Called by the provider when the web socket connection has an incoming partial binary message from the given remote endpoint. |
void |
onPartialMessage(RemoteEndpoint gs,
String partialString,
boolean last)
Called by the provider when the web socket connection has an incoming partial text message from the given remote endpoint. |
void |
onPing(RemoteEndpoint gs,
ByteBuffer bytes)
Called by the provider when the web socket connection has an incoming ping message from the given remote endpoint. |
void |
onPong(RemoteEndpoint gs,
ByteBuffer bytes)
Called by the provider when the web socket connection has an incoming pong message from the given remote endpoint. |
void |
remove()
Called by the provider after all connections have been closed to this endpoint, and after the endpoint has been removed from service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EndpointWrapper(Endpoint endpoint,
EndpointConfiguration configuration,
ClientContainer container,
String contextPath)
| Method Detail |
|---|
public boolean checkHandshake(SPIHandshakeRequest hr)
SPIEndpoint
checkHandshake in class SPIEndpointhr - SPIHandshakeRequest that is going to be checked.
true if handshake is successful false otherwise.
public Object decodeCompleteMessage(Object message,
Class<?> type,
boolean isString)
public List<String> getNegotiatedExtensions(List<String> clientExtensions)
SPIEndpoint
getNegotiatedExtensions in class SPIEndpointclientExtensions - names of the extensions' supported by client.
public String getNegotiatedProtocol(List<String> clientProtocols)
SPIEndpoint
getNegotiatedProtocol in class SPIEndpointclientProtocols - sub - protocols supported by client.
null if none found.public void remove()
SPIEndpoint
remove in class SPIEndpoint
public void onConnect(RemoteEndpoint gs,
String subprotocol,
List<String> extensions)
SPIEndpoint
onConnect in class SPIEndpointgs - SPIRemoteEndpoint who has just connected to this web socket endpoint.
public void onMessage(RemoteEndpoint gs,
ByteBuffer messageBytes)
SPIEndpoint
onMessage in class SPIEndpointgs - SPIRemoteEndpoint who sent the message.messageBytes - the message.
public void onMessage(RemoteEndpoint gs,
String messageString)
SPIEndpoint
onMessage in class SPIEndpointgs - SPIRemoteEndpoint who sent the message.messageString - the String message.
public void onPartialMessage(RemoteEndpoint gs,
String partialString,
boolean last)
SPIEndpoint
onPartialMessage in class SPIEndpointgs - SPIRemoteEndpoint who sent the message.partialString - the String message.last - to indicate if this is the last partial string in the sequence
public void onPartialMessage(RemoteEndpoint gs,
ByteBuffer partialBytes,
boolean last)
SPIEndpoint
onPartialMessage in class SPIEndpointgs - SPIRemoteEndpoint who sent the message.partialBytes - the piece of the binary message.last - to indicate if this is the last partial byte buffer in the sequence
public void onPong(RemoteEndpoint gs,
ByteBuffer bytes)
SPIEndpoint
onPong in class SPIEndpointgs - SPIRemoteEndpoint who sent the message.bytes - the message.
public void onPing(RemoteEndpoint gs,
ByteBuffer bytes)
SPIEndpoint
onPing in class SPIEndpointgs - SPIRemoteEndpoint who sent the message.bytes - the message.public void onClose(RemoteEndpoint gs)
SPIEndpoint
onClose in class SPIEndpointgs - SPIRemoteEndpoint who has just closed the connection.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||