public class ClientSocketAdapter
extends org.eclipse.jetty.websocket.api.WebSocketAdapter
| Constructor and Description |
|---|
ClientSocketAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
modifyRequest(org.eclipse.jetty.websocket.client.ClientUpgradeRequest req)
this method is called when the request to the server is created.
|
protected <T> T |
readMessage(String message,
Class<T> clazz)
reads the received string into the given class by parsing JSON
|
void |
sendObjectToSocket(Object o)
send the given object to the server using JSON serialization
|
public void modifyRequest(org.eclipse.jetty.websocket.client.ClientUpgradeRequest req)
req - the created request that can be modifiedpublic final void sendObjectToSocket(Object o)
o - the object to send to the serverprotected final <T> T readMessage(String message, Class<T> clazz)
T - the expected typemessage - the JSON stringclazz - the target class of type TCopyright © 2013–2015 Taimos GmbH. All rights reserved.