|
Re: How to listen for process termination [message #283507 is a reply to message #283468] |
Mon, 04 April 2005 18:33 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: john.eclipsefaq.org
Your problem is unrelated to the Jobs framework. The debugger was using
a job to listen for process termination. This job was changed to a
simple java.lang.Thread in the 3.0.2 release. Here is a bug with the
details:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=75454
You might want to ask the same question with a different subject line to
find out the best way to listen for process termination. Your previous
approach of listening for a job with a given name was brittle, as it
depended on an implementation detail of the debugger's launch framework.
The launch framework fires an event when processes terminate, you just
need to figure out where to attach a listener to get this information.
--
Simon Lever wrote:
> Hi,
>
> I have been creating a plugin within Eclipse working entirely on version
> 3.0.1.
> One of my requirements is that I need to find out when a java program
> has completely finished executing in the console either by natural
> termination or user termination by clicking the red terminate button. I
> successfully did this in version 3.0.1 by adding an IJobChangeListener
> to the platform's job manager:
>
> final IJobManager jobManager = Platform.getJobManager();
>
> then adding a IJobChangeListener to this implementing the done() method
> only by using the JobChangeAdapter class, which has the signature:
>
> public void done(IJobChangeEvent event) {...
>
>
> I then monitor all the jobs that have been "done" and I found that the
> job that is lastly done when a java program is terminated either
> naturally or by user interaction is the job with the name "Process
> monitor". (I found this out by examining the "Progress" view when
> executing a java program). I find this out by:
>
> if (event.getJob().getName().equals("Process monitor")) {...
>
>
> I have now upgraded to eclipse 3.0.2 and it appears that the jobs
> framework has changed where this job is no longer processed and
> consequently I have no way of knowing when a java program has
> terminated, which is the critical part of my plugin. I thought at first
> that the Job name had changed, but in fact no jobs are done to notify a
> java program has finished executing in 3.0.2. Hence my plugin no longer
> works. I can't find any documentation at all either relating to this
> apparent change.
>
>
> My question is then, is there any reason why this was removed from the
> latest eclipse version and is there any other possible way of finding
> out when a java program has finished executing?
>
> Many Thanks,
>
> Simon.
>
>
>
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03060 seconds