发送请求之前的 GWT RPC 客户端序列
我提出了上一个问题,寻找在 RPC 调用上构建内容的类(here )。
现在,我没有找到导致调用类 ClientSerializationStreamWriter(此处):
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
writeHeader(buffer);
writeStringTable(buffer);
writePayload(buffer);
return buffer.toString();
}
我注意到 ClientSerializationStreamWriter 在 RemoteServiceProxy 中使用,并且该类在 RpcServiceProxy 上进行了扩展。我试图找到的是在发送之前构建请求的确切点。 RemoteServiceProxy 中的 doInvoke 方法似乎负责调度请求本身,但是 String requestData 是如何构建的?
com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.doInvoke
我想了解 RPC 请求在离开客户端 Web 浏览器之前执行的常规路径。到目前为止我还不确定每个 RPC 都使用 RpcServiceProxy。
我有很多假设,但没有断言。
谢谢。
聚达克
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许了解有关调用堆栈的更多信息的最佳方法是使用 Java 调试器(这在开发模式下是可能的 - 即使对于客户端代码也是如此!)
关于您的其他问题:
/com/google/gwt/rpc/RPC.gwt.xml
(gwt-user.jar) 为您的RemoteService
指定延迟绑定:RpcServiceGenerator:
RpcProxyCreator:
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:
/com/google/gwt/rpc/RPC.gwt.xml
(gwt-user.jar) specifies a deferred binding for yourRemoteService
s:RpcServiceGenerator:
RpcProxyCreator:
我找到了我的问题的可能答案。在类 ProxyCreator 行中:479。
在创建我的服务期间,
GWT 编译器动态生成 RPC 代理,此时 GWT 编译器注入代理方法(ProxyCreator.generateProxyMethod)。
华泰
I found the probably answer to my question. In the Class ProxyCreator line: 479.
During the creation of my service
GWT compiler generates dynamically the RPC proxy, in this moment GWT compiler inject the proxy method (ProxyCreator.generateProxyMethod).
HTH