Inter-plugin communication in Eclipse

前端 未结 2 1296
野的像风
野的像风 2021-02-10 13:42

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:

  • ind
2条回答
  •  时光说笑
    2021-02-10 14:26

    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:

    • Getting Started with OSGi: Introducing Declarative Services
    • Getting Started with OSGi: Declarative Services and Dependencies

提交回复
热议问题