Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Execute commands on a RCP instance by using command lines
Execute commands on a RCP instance by using command lines [message #1725200] Tue, 01 March 2016 15:22 Go to next message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Hi,

I would like to know if it's possible to execute commands on a running RCP instance by using the same RCP executable.

My scenario is the following:

1. I run a instance of my RCP.
2. I use the same executable with some arguments to be executed in the running RCP.
3. The running RCP process the arguments given and continue running.

Thanks for your help.

Carlos

[Updated on: Tue, 01 March 2016 15:34]

Report message to a moderator

Re: Execute commands on a RCP instance by using command lines [message #1725214 is a reply to message #1725200] Tue, 01 March 2016 18:38 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Eclipse has some limited support for this built-in to allow opening files. Have a look at https://wiki.eclipse.org/Eclipse/OpenFileFeature

However as that is limited to really just opening files, what I have done to solve me (nearly identical) problem is add a TCP/IP socket server into my RCP app that listens to requests which are simply command lines from my custom exe. Rather than edit/extend eclipse{.exe}, I wrote a wrapper program for eclipse{.exe}that would either launch eclipse{.exe} or connect to the TCP/IP socket and send the request that way.

I would be happy to discuss further if interested.

Re: Execute commands on a RCP instance by using command lines [message #1725272 is a reply to message #1725214] Wed, 02 March 2016 08:48 Go to previous messageGo to next message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Thanks Jonah for your answer.

How you say, OpenFileFeature is a too limited feature to resolve our problem. I was thinking in your solution, but I don't want to open sockets for managing the application instances.

In my case, I need a frontend to improve the performance when my application is called. Using directly my RCP is long (loading plugins) if it is executed many times using different options.

So, this frontend starts/stops my RCP when it is necessary, and sends commands to the running instance. In this way, my performance is improved.

In a client/server solution, the first thought is to use sockets, but I'm not in a network environment, and I could have some limits to use ports for my solution if I'm working in one machine. I think it's better to work at process level. If a process of my RCP is running, my "client" looks for this process and sends the corresponding commands.

Has someone worked in this solution?

Thanks for your help
Re: Execute commands on a RCP instance by using command lines [message #1725288 is a reply to message #1725272] Wed, 02 March 2016 09:34 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Well I don't know if someone has worked on this solution. At a technical level you are talking about named pipes/shared memory/something similar. Depending on your exact use case* doing a socket listen on localhost will have similar performance. Note that doing a socket on localhost is "cheap" compared to full networking as the network stack is short circuited. The other advantage is it is cross platform and a very very common way of doing IPC.

* data throughput/delay time, e.g. database connection is very different than command lines
Re: Execute commands on a RCP instance by using command lines [message #1725302 is a reply to message #1725288] Wed, 02 March 2016 10:56 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

FWIW, there is a library for java interprocess communication here [1]

[1] http://clipc.sourceforge.net/
Re: Execute commands on a RCP instance by using command lines [message #1727562 is a reply to message #1725302] Wed, 23 March 2016 21:37 Go to previous message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Thanks Jonah for your advice. In fact, I developed a small solution based on files. But you have a good point, multi-platform Wink So, maybe I will change it to a socket solution.

Thanks Wim for the library, I will check it Wink
Previous Topic:E4 Commands and Handlers
Next Topic:Dynamic icons
Goto Forum:
  


Current Time: Thu Apr 25 10:34:41 GMT 2024

Powered by FUDForum. Page generated in 0.03626 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top