GWT 2.x $输入功能 [英] GWT 2.x $entry function

查看:135
本文介绍了GWT 2.x $输入功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找不到关于此功能的任何开发者信息。我只知道建议使用这个 $ entry 函数将JSNI JavaScript调用包装到Java方法中。我发现它捕获异常,所以Java代码可以处理它们。如果你想确切地知道发生了什么,看看 com。它是一切吗?

google.gwt.core.client.impl.Impl.entry(JavaScript对象jsFunction)



这个函数(至少在GWT 2.2.0 )主要调用 entry0(Object jsFunction,Object thisObj,Object arguments),它执行以下操作:


  • 首先,它刷新由 Scheduler.scheduleEntry()

  • 计划的所有内容然后确保执行如果存在这样的处理程序,则可以在try块中将jsFunction转发给 GWT.getUncaughtExceptionHandler()
  • 最后,它会刷新由 Scheduler.scheduleFinally()


Cannot find any developer information about this function. I just know that it's suggested to wrap JSNI JavaScript calls to Java methods with this $entry function. I found that it catches exceptions so Java code could handle them. Is it all it does?

解决方案

If you want to know exactly what happens, look into com.google.gwt.core.client.impl.Impl.entry(JavaScriptObject jsFunction).

This function (at least in GWT 2.2.0) mainly calls entry0(Object jsFunction, Object thisObj, Object arguments), which does the following:

  • First, it flushes anything that has been scheduled by Scheduler.scheduleEntry()
  • Then it makes sure to execute the jsFunction in a try block, to forward Exceptions to GWT.getUncaughtExceptionHandler(), if there is such a handler.
  • Finally, it flushes anything that has been scheduled by Scheduler.scheduleFinally()

这篇关于GWT 2.x $输入功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆