org.atmosphere.gwt.client
Class AtmosphereGWTSerializer

java.lang.Object
  extended by org.atmosphere.gwt.client.AtmosphereGWTSerializer

public abstract class AtmosphereGWTSerializer
extends Object

The base class for serializers. To instantiate this class follow this example:



 @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 {}
 
 


Field Summary
protected  JSONObjectSerializer jsonSerializer
           
 
Constructor Summary
AtmosphereGWTSerializer()
           
 
Method Summary
abstract  Object deserialize(String message)
           
protected  Object deserializeJSON(String message)
           
protected  Object deserializePLAIN(String message)
           
protected  Object deserializeRPC(String message)
           
abstract  SerialMode getMode()
           
abstract  SerialMode getPushMode()
           
protected abstract  com.google.gwt.user.client.rpc.impl.Serializer getRPCSerializer()
           
abstract  String serialize(Object message)
           
protected  String serializeJSON(Object message)
           
protected  String serializePLAIN(Object message)
           
protected  String serializeRPC(Object message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jsonSerializer

protected JSONObjectSerializer jsonSerializer
Constructor Detail

AtmosphereGWTSerializer

public AtmosphereGWTSerializer()
Method Detail

getMode

public abstract SerialMode getMode()

getPushMode

public abstract SerialMode getPushMode()

deserialize

public abstract Object deserialize(String message)
                            throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

deserializeRPC

protected Object deserializeRPC(String message)
                         throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

deserializeJSON

protected Object deserializeJSON(String message)
                          throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

deserializePLAIN

protected Object deserializePLAIN(String message)
                           throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

serialize

public abstract String serialize(Object message)
                          throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

serializeRPC

protected String serializeRPC(Object message)
                       throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

serializeJSON

protected String serializeJSON(Object message)
                        throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

serializePLAIN

protected String serializePLAIN(Object message)
                         throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

getRPCSerializer

protected abstract com.google.gwt.user.client.rpc.impl.Serializer getRPCSerializer()


Copyright © 2012. All Rights Reserved.