Eclipse 中的插件间通信
是否可以创建自动发现彼此的 Eclipse 插件?
我正在开发一组插件,需要在两种主要情况下运行:
- 单独地
- 相互协调。
当单独运行时,插件应该“正常工作”,但是当协同运行时,它们将共享一些相同的模型内容,并且其中一个插件应该向用户提供其他插件的列表以与之共享内容。 例如:
Foo 插件检测到以下内容 它可以与之共享本体的插件:
[ ] 栏插件
[] Baz 插件
[] 不分享
Eclipse 是否提供任何内部发布/检测方法来促进这种对其他插件的自动检测?
Is it possible to create Eclipse plugins that auto-discover eachother?
I am developing a set of plugins that need to operate in two primary situations:
- individually
- in concert with each other.
When run individually, the plugins should "just work" but when in concert, they will be sharing some of the same model content, and one of the plugins should present the user with a list of other plugins to share content with. eg:
Foo Plugin detected the following
plugins it can share ontologies with:[ ] Bar plugin
[ ] Baz plugin
[ ] Don't share
Does Eclipse offer any internal publication / detection methods that would facilitate this sort of auto-detection of other plugins?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案应该是通过声明式服务,它结合了优点eclipse xml 扩展和 osgi POJO 服务。 像 osgi 服务一样隐式动态的东西,但像 eclipse 扩展一样“按需”加载。
这些概念于 2006 年针对 eclipse3.3 引入,您将在 此演示文稿。
在实践中,这些 DS(声明性服务) 并不容易使用,因为您有访问 BundleContext,意味着跟踪 BundleActivator,这是并不总是那么容易...
如果您需要定义某种面向服务的组件模型,此演示文稿应该为您提供当今现有的不同替代方案,并详细说明这些“声明式服务”
以发布 rcreswick 的发现与 DS 相关:
The answer should be through Declarative Service, which combines the advantages of both eclipse xml extensions and osgi POJO services. Something that is implicitly dynamic like osgi services, but loaded “on demand” like eclipse extensions.
Introduced in 2006 for eclipse3.3, you will find those concepts illustrated in this presentation.
In practice, those DS (Declarative Services) are not easy to use, as you have to access the BundleContext, meaning keeping track of the BundleActivator, which is not always easy...
If what you need is to define some sort of Service Oriented Component Model, this presentation should provide you with the different alternatives existing today, as well as detailing those "Declarative Services"
To publish what rcreswick has found in relation with DS:
那么,OSGI服务注册中心可以在运行时完成基于pojo的服务的共享,而不是插件本身。 有几个选项可以促进这一点,例如直接编码到 OSGI API、声明性服务、Spring DM 和 iPojo(我确信还有其他选项)。
您可能想要查看白板模式作为完成动态观察者/可观察样式解决方案的一种方法。
Well, the OSGI Service Registry can accomplish the sharing of pojo based services at runtime, not the plugins themselves. There are several options to facilitate this, such as coding directly to the OSGI API, Declarative Services, Spring DM and iPojo (I am sure there are others as well).
You may want to check out the Whiteboard Pattern as a means of accomplishing a dynamic Observer/Observable style solution.