Eclipse 中的插件间通信

发布于 2024-07-07 06:45:52 字数 387 浏览 3 评论 0原文

是否可以创建自动发现彼此的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧人 2024-07-14 06:45:52

答案应该是通过声明式服务,它结合了优点eclipse xml 扩展和 osgi POJO 服务。 像 osgi 服务一样隐式动态的东西,但像 eclipse 扩展一样“按需”加载。

这些概念于 2006 年针对 eclipse3.3 引入,您将在 此演示文稿

声明性服务提供了定义对其他服务的引用的选项。 还可以指定引用的基数。 基数使用两个数字指定,第一个数字 0 或 1 表示可选性,第二个数字 1 或 n 表示多重性。

在实践中,这些 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.

Declarative Services gives the option to define reference to other services. It is also possible to specify the cardinality of the reference. The cardinality is specified using two numbers, the first one, 0 or 1, indicates the optionality, the second one, 1 or n, indicates the multiplicity.

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:

失退 2024-07-14 06:45:52

那么,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文