Package com.googlecode.gwt.test.rpc

Source Code of com.googlecode.gwt.test.rpc.MyServiceImpl

package com.googlecode.gwt.test.rpc;

import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.googlecode.gwt.test.client.MyChildObject;
import com.googlecode.gwt.test.client.MyObject;

@RemoteServiceRelativePath("myService")
public class MyServiceImpl extends RemoteServiceServlet implements MyService {

   private static final long serialVersionUID = 7323341628793612279L;

   public String getHttpRequestHeader(String header) {
      return getThreadLocalRequest().getHeader(header);
   }

   public void someCallWithException() {
      throw new RuntimeException("Server side thrown exception !!");
   }

   public MyObject update(MyObject object) {
      object.setMyField("updated field by server side code");
      object.setMyTransientField("this will not be serialized");

      MyChildObject childObject = new MyChildObject("this is a child !");
      childObject.setMyChildTransientField("this will not be serialized too");
      childObject.setMyField("the field inherited from the parent has been updated !");
      childObject.setMyTransientField("this field is not expected to be serialized too");

      object.getMyChildObjects().add(childObject);

      return object;
   }

}
TOP

Related Classes of com.googlecode.gwt.test.rpc.MyServiceImpl

TOP
Copyright © 2018 www.massapi.com. 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.