Package com.google.gwt.rpc.server

Examples of com.google.gwt.rpc.server.SimplePayloadDecoder


*/
public class ClientWriterFactory {

  public static SerializationStreamReader createReader(String payload)
      throws IncompatibleRemoteServiceException, RemoteException {
    SimplePayloadDecoder decoder;
    try {
      decoder = new SimplePayloadDecoder(new HostedModeClientOracle(), payload);
    } catch (ClassNotFoundException e) {
      throw new IncompatibleRemoteServiceException(
          "Client does not have a type sent by the server", e);
    }
    CommandServerSerializationStreamReader reader = new CommandServerSerializationStreamReader();
    if (decoder.getThrownValue() != null) {
      reader.prepareToRead(Collections.singletonList(decoder.getThrownValue()));
      try {
        throw new RemoteException((Throwable) reader.readObject());
      } catch (ClassCastException e) {
        throw new RemoteException(
            "The remote end threw something other than a Throwable", e);
      } catch (SerializationException e) {
        throw new RemoteException(
            "The remote end threw an exception which could not be deserialized",
            e);
      }
    } else {
      reader.prepareToRead(decoder.getValues());
    }
    return reader;
  }
View Full Code Here


*/
public class ClientWriterFactory {

  public static SerializationStreamReader createReader(String payload)
      throws IncompatibleRemoteServiceException, RemoteException {
    SimplePayloadDecoder decoder;
    try {
      decoder = new SimplePayloadDecoder(new HostedModeClientOracle(), payload);
    } catch (ClassNotFoundException e) {
      throw new IncompatibleRemoteServiceException(
          "Client does not have a type sent by the server", e);
    }
    CommandServerSerializationStreamReader reader = new CommandServerSerializationStreamReader();
    if (decoder.getThrownValue() != null) {
      reader.prepareToRead(Collections.singletonList(decoder.getThrownValue()));
      try {
        throw new RemoteException((Throwable) reader.readObject());
      } catch (ClassCastException e) {
        throw new RemoteException(
            "The remote end threw something other than a Throwable", e);
      } catch (SerializationException e) {
        throw new RemoteException(
            "The remote end threw an exception which could not be deserialized",
            e);
      }
    } else {
      reader.prepareToRead(decoder.getValues());
    }
    return reader;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.rpc.server.SimplePayloadDecoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.