How to create Swing OSGi bundles on AWT EventQueue with Spring DM

好久不见. 提交于 2019-12-11 14:06:15

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/3561161/how-to-create-swing-osgi-bundles-on-awt-eventqueue-with-spring-dm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!