org.atmosphere.gwt20.client
Class AutoBeanClientSerializer

java.lang.Object
  extended by org.atmosphere.gwt20.client.AutoBeanClientSerializer
All Implemented Interfaces:
ClientSerializer

public class AutoBeanClientSerializer
extends Object
implements ClientSerializer

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


Constructor Summary
AutoBeanClientSerializer()
           
 
Method Summary
 Object deserialize(String raw)
          You need to implement this method in your serializer
 void registerBeanFactory(com.google.web.bindery.autobean.shared.AutoBeanFactory factory, Class forBean)
           
 void registerBeanFactory(Class<com.google.web.bindery.autobean.shared.AutoBeanFactory> factoryClass, Class forBean)
           
 String serialize(Object message)
          You need to implement this method in your serializer
 void setActiveBeanFactory(Class forBean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoBeanClientSerializer

public AutoBeanClientSerializer()
Method Detail

registerBeanFactory

public void registerBeanFactory(Class<com.google.web.bindery.autobean.shared.AutoBeanFactory> factoryClass,
                                Class forBean)

registerBeanFactory

public void registerBeanFactory(com.google.web.bindery.autobean.shared.AutoBeanFactory factory,
                                Class forBean)

setActiveBeanFactory

public void setActiveBeanFactory(Class forBean)

deserialize

public Object deserialize(String raw)
                   throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: ClientSerializer
You need to implement this method in your serializer

Specified by:
deserialize in interface ClientSerializer
Throws:
com.google.gwt.user.client.rpc.SerializationException

serialize

public String serialize(Object message)
                 throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: ClientSerializer
You need to implement this method in your serializer

Specified by:
serialize in interface ClientSerializer
Throws:
com.google.gwt.user.client.rpc.SerializationException


Copyright © 2015. All Rights Reserved.