如何使用 Spring DM 在 AWT EventQueue 上创建 Swing OSGi 包
我有一个 OSGi 目标平台,其中包含 Equinox、Spring Framework、Spring DM 和几个适用于我的应用程序的自定义捆绑包。我的所有包都包含 Spring 应用程序上下文,因此由 Spring OSGi 扩展器自动加载。
我的一些包包含 Swing ui 组件。问题在于 Spring OSGi Extender 不会在 AWT EventQueue 上创建这些应用程序上下文,这会导致多个 ui 问题。
到目前为止我发现的唯一解决方法是为 spring-osgi-extender 创建一个片段包并配置“taskExecutor”,如所述 此处。基本上,我的自定义taskExecutor 实现将所有execute() 调用转发到AWT EventQueue。这并不是一个真正好的解决方案,因为我的应用程序中所有由 Spring 驱动的包都将在 AWT 线程上创建,从而减慢了启动时的 ui(并且基本上终止了我们的启动屏幕加载状态,因为它缺乏任何刷新)。
关于如何在 AWT EventQueue 上创建这些 Spring/Swing 包有什么想法吗?
I have an OSGi target platform consisting of Equinox, the Spring Framework, Spring DM, and several custom bundles for my application. All of my bundles contain Spring application contexts and so are automatically loaded by the Spring OSGi extender.
Some of my bundles contain Swing ui components. The problem is that the Spring OSGi Extender does not create these application contexts on the AWT EventQueue which results in several ui issues.
The only workaround I've found so far is to create a fragment bundle for the spring-osgi-extender and configure the "taskExecutor" as mentioned here. Basically my custom taskExecutor implementation forwards all execute() calls to the AWT EventQueue. This is not really a good solution since ALL the Spring-powered bundles in my application will be created on the AWT thread, slowing down the ui at start-up (and basically killing our splash screen load status since it's starved of any refresh).
Any ideas about how to create those Spring/Swing bundles on the AWT EventQueue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有直接回答你的问题,但以下项目应该可以帮助你解决这个问题。
http://max-server.myftp.org/trac/pm
I don't have a direct answer to your question, but the following project should help you to figure it out.
http://max-server.myftp.org/trac/pm