Example usage for com.google.gwt.user.server.rpc.impl ServerSerializationStreamReader readObject

List of usage examples for com.google.gwt.user.server.rpc.impl ServerSerializationStreamReader readObject

Introduction

In this page you can find the example usage for com.google.gwt.user.server.rpc.impl ServerSerializationStreamReader readObject.

Prototype

public Object readObject() throws SerializationException 

Source Link

Usage

From source file:org.atmosphere.gwt.server.AtmosphereGwtHandler.java

License:Apache License

protected Serializable deserialize(String data) {
    try {//from   w ww  .  jav  a 2 s  .c o m
        ServerSerializationStreamReader reader = new ServerSerializationStreamReader(
                getClass().getClassLoader(), cometSerializationPolicyProvider);
        reader.prepareToRead(data);
        return (Serializable) reader.readObject();
    } catch (SerializationException ex) {
        logger.error("Failed to deserialize message", ex);
        return null;
    }
}

From source file:org.opencms.ui.components.extensions.CmsPropertyDialogExtension.java

License:Open Source License

/**
 * @see org.opencms.ui.shared.rpc.I_CmsPropertyServerRpc#savePropertiesForNewResource(java.lang.String)
 *///from  w w w  .j  a v  a  2s. co  m
public void savePropertiesForNewResource(String data) {

    try {
        getRpcProxy(I_CmsPropertyClientRpc.class).confirmSaveForNew();
        ServerSerializationStreamReader streamReader = new ServerSerializationStreamReader(
                Thread.currentThread().getContextClassLoader(), null);
        // Filling stream reader with data
        streamReader.prepareToRead(data);
        // Reading deserialized object from the stream
        CmsPropertyChangeSet changes = (CmsPropertyChangeSet) (streamReader.readObject());
        m_newResourceBuilder.setPropertyChanges(changes);
        m_newResourceBuilder.safeCreateResource();
        remove();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}