Reputation: 85
I've made a previous question, looking for the class that build the content on a RPC call(here).
Now, I'm not finding the sequence of method calls that results on the call of the following method in the class ClientSerializationStreamWriter(here):
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
writeHeader(buffer);
writeStringTable(buffer);
writePayload(buffer);
return buffer.toString();
}
I noticed that the ClientSerializationStreamWriter is used in RemoteServiceProxy and that, this class is extended on RpcServiceProxy. What I'm trying to find is the exactly point where the request is build before the send. The method doInvoke from RemoteServiceProxy seems to be responsible for dispatching the request itself, but how the String requestData is build?
com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.doInvoke
I want to understand the regular path a RPC request does before it leaves clients web browser. So far I'm not sure that every RPC uses RpcServiceProxy.
I have a lot of assumptions and none assertion.
Thanks.
JuDaC
Upvotes: 1
Views: 733
Reputation: 85
I found the probably answer to my question. In the Class ProxyCreator line: 479.
String payloadName = nameFactory.createName("payload");
w.println("String " + payloadName + " = " + streamWriterName
+ ".toString();");
During the creation of my service
private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
GWT compiler generates dynamically the RPC proxy, in this moment GWT compiler inject the proxy method (ProxyCreator.generateProxyMethod).
com.google.gwt.user.rebind.rpc.ProxyCreator.generateProxyMethod
HTH
Upvotes: 1
Reputation: 37788
Maybe the best way to find out more about the call stack is by using a Java Debugger (that's possible in Development Mode - even for the client side code!)
About your other question:
So far I'm not sure that every RPC uses RpcServiceProxy.
/com/google/gwt/rpc/RPC.gwt.xml
(gwt-user.jar) specifies a deferred binding for your RemoteService
s:
<generate-with class="com.google.gwt.rpc.rebind.RpcServiceGenerator">
...
<when-type-assignable class="com.google.gwt.user.client.rpc.RemoteService" />
...
</generate-with>
RpcServiceGenerator:
protected ProxyCreator createProxyCreator(JClassType remoteService) {
return new RpcProxyCreator(remoteService);
}
RpcProxyCreator:
protected Class<? extends RemoteServiceProxy> getProxySupertype() {
return RpcServiceProxy.class;
}
Upvotes: 1