public abstract class GwtRpcClientSerializer extends java.lang.Object implements ClientSerializer
@SerialTypes({ MyType1.class, MyType2.class })
public abstract class MyCometSerializer extends AtmosphereGWTSerializer {}
AtmosphereGWTSerializer serializer = GWT.create(MyCometSerializer.class);
AtmosphereClient client = new AtmosphereClient(url, serializer, listener);
Where MyType1 and MyType2 are the types that your expecting to receive from the server.
If you have a class hierarchy of messages that you want to send you only need to supply the base class here.
For instance:
public class Message {}
public class MessageA extends Message {}
public class MessageB extends Message {}
@SerialTypes( Message.class )
public abstract class MyCometSerializer extends AtmosphereGWTSerializer {}
| Constructor and Description |
|---|
GwtRpcClientSerializer() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
deserialize(java.lang.String raw)
You need to implement this method in your serializer
|
protected abstract com.google.gwt.user.client.rpc.impl.Serializer |
getRPCSerializer() |
java.lang.String |
serialize(java.lang.Object message)
You need to implement this method in your serializer
|
public java.lang.Object deserialize(java.lang.String raw)
throws com.google.gwt.user.client.rpc.SerializationException
ClientSerializerdeserialize in interface ClientSerializercom.google.gwt.user.client.rpc.SerializationExceptionpublic java.lang.String serialize(java.lang.Object message)
throws com.google.gwt.user.client.rpc.SerializationException
ClientSerializerserialize in interface ClientSerializercom.google.gwt.user.client.rpc.SerializationExceptionprotected abstract com.google.gwt.user.client.rpc.impl.Serializer getRPCSerializer()
Copyright © 2018. All Rights Reserved.