Package org.atmosphere.gwt20.client
Class AutoBeanClientSerializer
- java.lang.Object
-
- org.atmosphere.gwt20.client.AutoBeanClientSerializer
-
- All Implemented Interfaces:
ClientSerializer
public class AutoBeanClientSerializer 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 AutoBeanClientSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdeserialize(java.lang.String raw)You need to implement this method in your serializervoidregisterBeanFactory(com.google.web.bindery.autobean.shared.AutoBeanFactory factory, java.lang.Class forBean)java.lang.Stringserialize(java.lang.Object message)You need to implement this method in your serializervoidsetActiveBeanFactory(java.lang.Class forBean)
-
-
-
Method Detail
-
registerBeanFactory
public void registerBeanFactory(com.google.web.bindery.autobean.shared.AutoBeanFactory factory, java.lang.Class forBean)
-
setActiveBeanFactory
public void setActiveBeanFactory(java.lang.Class forBean)
-
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
-
-