Package org.atmosphere.gwt20.client
Class GwtRpcClientSerializer
- java.lang.Object
-
- org.atmosphere.gwt20.client.GwtRpcClientSerializer
-
- All Implemented Interfaces:
ClientSerializer
- Direct Known Subclasses:
RPCSerializer
public abstract class GwtRpcClientSerializer extends java.lang.Object implements ClientSerializer
The base class for serializers. To instantiate this class follow this example:
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:@SerialTypes({ MyType1.class, MyType2.class }) public abstract class MyCometSerializer extends AtmosphereGWTSerializer {} AtmosphereGWTSerializer serializer = GWT.create(MyCometSerializer.class); AtmosphereClient client = new AtmosphereClient(url, serializer, listener);public class Message {} public class MessageA extends Message {} public class MessageB extends Message {} @SerialTypes( Message.class ) public abstract class MyCometSerializer extends AtmosphereGWTSerializer {}
-
-
Constructor Summary
Constructors Constructor Description GwtRpcClientSerializer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdeserialize(java.lang.String raw)You need to implement this method in your serializerprotected abstract com.google.gwt.user.client.rpc.impl.SerializergetRPCSerializer()java.lang.Stringserialize(java.lang.Object message)You need to implement this method in your serializer
-
-
-
Method Detail
-
deserialize
public java.lang.Object deserialize(java.lang.String raw) throws com.google.gwt.user.client.rpc.SerializationExceptionDescription copied from interface:ClientSerializerYou need to implement this method in your serializer- Specified by:
deserializein interfaceClientSerializer- Throws:
com.google.gwt.user.client.rpc.SerializationException
-
serialize
public java.lang.String serialize(java.lang.Object message) throws com.google.gwt.user.client.rpc.SerializationExceptionDescription copied from interface:ClientSerializerYou need to implement this method in your serializer- Specified by:
serializein interfaceClientSerializer- Throws:
com.google.gwt.user.client.rpc.SerializationException
-
getRPCSerializer
protected abstract com.google.gwt.user.client.rpc.impl.Serializer getRPCSerializer()
-
-