Inter-plugin communication in 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?
Asked by: Jared865 | Posted: 23-01-2022
Answer 1
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
Answer 2
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.
Answered by: Rubie335 | Posted: 24-02-2022Similar questions
java - Best Practice: network communication
java - Quick and dirty solution for communication between processes in different machines
Establishing communication between Java client and .NET server
I would like to create a server using .NET and Java client (Android application).
The client will be connected to the server through mobile network so it's impossible to use tcp socket for two-way communication.
I would like to develop a logic for client login:
The client sends username and password to the server and server replies (connected/not connected). Then if client is connected it starts sen...
java - Communication between the EDT and main threads
I have been asking a lot of questions about a project I have been working on recently. Here is the scenario I am in and any help or point in the right direction would help a lot...
This is a network program built with a server and multiple clients. Each client has a GUI which must act according to commands sent from the server. Each client is wrapped within a class called Player. This Player
How to read to inputstream in tcp socket communication for multiple formats in java
In TCP based communication, I need to, listen/read to, multiple formats on DataInputStream. Such as write and writeUTF.
I need to identify the mode used by other end to switch to that mode such as when writeUTF(String) is used I need to use readUTF(), and if the write(byte[]) is used then I should be able to switch to read() to get data.
I tried to use the markSupported,mark, reset but could not...
sockets - how to write a complete server client communication using java nio
Closed. This question does not meet Stack Overflow guid...
communication - Java: appropriate way to pass messages between client and servlet?
My system successfully passes objects from a client to servlet. However it is primitive as it was built to cater for Java 1.1. The message object it passes consists of an int (representing one of about seventy types) and a String of tokens which need to be parsed (the tokens may contain a list, a list of objects, etc). Not good!
So, I'm looking to refactor this to Java 1.5. Using an enum instead of an int is certai...
Java applet communication with Rails application
I'm creating a Rails application and on it, there should be a Java Applet.
My question and problem is that the applet must be tightly integrated with the Rails parts. I must be able to get a list of all users, update an image, etc... And there's a surprisingly small amount of information available on the Internet of how to use applets with Rails. So please give me some hints. What is the best way to do it?
Communication problem between Java and C++ app on stdin
I have a java app here that starts a C++ app via the java.lang.Process API and then tries to send commands to it via the stdin pipe:
process.getOutputStream().write("foo\n");
process.getOutputStream().flush();
On the C++ side there's a loop running that checks for input in stdin and if there is some
it reads it. Unfortunately the checking always returns 0, hence it never tries to read. If I remove the...
java - Servlets and AJAX communication
I do have a communication problem here between my Java servlet and an Ajax request. more about it:
Absolute path to the index.html (including JavaScript/Ajax request):
http://localhost:9080/chat/index.html
In the same folder the servlet:
MyChat.class
And the Request is working like this:
var url = "http://localhost:9080/chat";
var name = document.getElementById(&q...
Still can't find your answer? Check out these amazing Java communities for help...
Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)