Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to wait for launches to finish
How to wait for launches to finish [message #333943] Wed, 14 January 2009 15:36 Go to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi,

I am programmatically triggering a launch using
DebugUITools.launch(launchConfig, "run"). This will create a new Job
that invokes the actual corresponding LaunchDelegate. In my code, I need
to do more work once this Job is done.

Unfortunately, it seems DebugUITools does not put this new Job into any
JobFamily. Therefore, I cannot use JobManager.join: Since the code I am
writing is in a Job itself, JobManager.join (null, monitor) deadlocks.
Is there any other way to wait for all Launches to finish?

Any hints would be greatly appreciated. Also, if this is the wrong
group, could you please direct me to the correct one?

Many thanks in advance,

Steffen

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
Phone +44 (01524) 510354
WWW http://www.steffen-zschaler.de/

--
Consider submitting to ECMDA-FA 2009, the 5th European Conference on
Model-Driven Architecture Foundations and Applications.
http://www.ecmda-fa.org/

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: How to wait for launches to finish [message #333952 is a reply to message #333943] Wed, 14 January 2009 16:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

Steffen Zschaler wrote:
> Hi,
>
> I am programmatically triggering a launch using
> DebugUITools.launch(launchConfig, "run"). This will create a new Job
> that invokes the actual corresponding LaunchDelegate. In my code, I need
> to do more work once this Job is done.
>
> Unfortunately, it seems DebugUITools does not put this new Job into any
> JobFamily. Therefore, I cannot use JobManager.join: Since the code I am
> writing is in a Job itself, JobManager.join (null, monitor) deadlocks.
> Is there any other way to wait for all Launches to finish?
>
> Any hints would be greatly appreciated. Also, if this is the wrong
> group, could you please direct me to the correct one?
>
> Many thanks in advance,
>
> Steffen
>
Have you tried:
jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD,monitor) ;
or jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD,monitor);


--
Derek
Re: How to wait for launches to finish [message #333966 is a reply to message #333952] Wed, 14 January 2009 17:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi Derek,

Thanks for the quick reply.

Comments below

Derek wrote:
> Steffen Zschaler wrote:
>> Hi,
>>
>> I am programmatically triggering a launch using
>> DebugUITools.launch(launchConfig, "run"). This will create a new Job
>> that invokes the actual corresponding LaunchDelegate. In my code, I
>> need to do more work once this Job is done.
>>
>> Unfortunately, it seems DebugUITools does not put this new Job into
>> any JobFamily. Therefore, I cannot use JobManager.join: Since the
>> code I am writing is in a Job itself, JobManager.join (null, monitor)
>> deadlocks. Is there any other way to wait for all Launches to finish?
>>
>> Any hints would be greatly appreciated. Also, if this is the wrong
>> group, could you please direct me to the correct one?
>>
>> Many thanks in advance,
>>
>> Steffen
>>
> Have you tried:
> jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD,monitor) ;
> or
> jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD,monitor);
No, these did not seem to make sense, as the jobs seem to be registered
without a family. Specifically, somewhere deep in Eclipse's logic
dealing with launch configurations, it will instantiate class Job
overriding only run(), but not belongsTo(). This means, this job will
not belong to any job family as far as I understand it.

I tried jobManager.join (null, monitor), but as I said above that
deadlocks as it essentially tries to join the job from which it calls
join...

Best regards,

Steffen

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
Phone +44 (01524) 510354
WWW http://www.steffen-zschaler.de/

--
Consider submitting to ECMDA-FA 2009, the 5th European Conference on
Model-Driven Architecture Foundations and Applications.
http://www.ecmda-fa.org/

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: How to wait for launches to finish [message #333968 is a reply to message #333966] Wed, 14 January 2009 18:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

Well, all I can see is this works for me, although I use
ResourcesPlugin.getWorkspace().build(buildType, monitor);

rather than DebugUITools

Steffen Zschaler wrote:
> Hi Derek,
>
> Thanks for the quick reply.
>
> Comments below
>
> Derek wrote:
>> Steffen Zschaler wrote:
>>> Hi,
>>>
>>> I am programmatically triggering a launch using
>>> DebugUITools.launch(launchConfig, "run"). This will create a new Job
>>> that invokes the actual corresponding LaunchDelegate. In my code, I
>>> need to do more work once this Job is done.
>>>
>>> Unfortunately, it seems DebugUITools does not put this new Job into
>>> any JobFamily. Therefore, I cannot use JobManager.join: Since the
>>> code I am writing is in a Job itself, JobManager.join (null, monitor)
>>> deadlocks. Is there any other way to wait for all Launches to finish?
>>>
>>> Any hints would be greatly appreciated. Also, if this is the wrong
>>> group, could you please direct me to the correct one?
>>>
>>> Many thanks in advance,
>>>
>>> Steffen
>>>
>> Have you tried:
>> jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD,monitor) ;
>> or
>> jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD,monitor);
> No, these did not seem to make sense, as the jobs seem to be registered
> without a family. Specifically, somewhere deep in Eclipse's logic
> dealing with launch configurations, it will instantiate class Job
> overriding only run(), but not belongsTo(). This means, this job will
> not belong to any job family as far as I understand it.
>
> I tried jobManager.join (null, monitor), but as I said above that
> deadlocks as it essentially tries to join the job from which it calls
> join...
>
> Best regards,
>
> Steffen
>


--
Derek
Re: How to wait for launches to finish [message #333975 is a reply to message #333943] Wed, 14 January 2009 20:47 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Can't you use ILaunchListener?

- Prakash

--

http://blog.eclipse-tips.com



"Steffen Zschaler" <szchaler@acm.org> wrote in message
news:gkl0qa$ve7$1@build.eclipse.org...
> Hi,
>
> I am programmatically triggering a launch using
> DebugUITools.launch(launchConfig, "run"). This will create a new Job that
> invokes the actual corresponding LaunchDelegate. In my code, I need to do
> more work once this Job is done.
>
> Unfortunately, it seems DebugUITools does not put this new Job into any
> JobFamily. Therefore, I cannot use JobManager.join: Since the code I am
> writing is in a Job itself, JobManager.join (null, monitor) deadlocks. Is
> there any other way to wait for all Launches to finish?
>
> Any hints would be greatly appreciated. Also, if this is the wrong group,
> could you please direct me to the correct one?
>
> Many thanks in advance,
>
> Steffen
>
> --
> Dr. rer. nat. Steffen Zschaler
> Senior Research Associate
>
> Lancaster University
> Lancaster, United Kingdom
>
> Email szschaler@acm.org
> Phone +44 (01524) 510354
> WWW http://www.steffen-zschaler.de/
>
> --
> Consider submitting to ECMDA-FA 2009, the 5th European Conference on
> Model-Driven Architecture Foundations and Applications.
> http://www.ecmda-fa.org/
>
> Consider submitting to QoSA 2009, the 5th International Conference on
> the Quality of Software-Architectures.
> http://qosa.ipd.uka.de/
>
> Consider submitting to MiSE 2009, the 3rd International Workshop on Models
> in Software Engineering
> http://wikiserver.sse.cs.tu-bs.de/mise09
Re: How to wait for launches to finish [message #333981 is a reply to message #333975] Thu, 15 January 2009 09:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi Prakash,

That sounds like an interesting idea. I've just had a look at
ILaunchListener. I cannot immediately see how to do it, I guess I'll
have to try some things and report back.

Many thanks so far,

Steffen

Prakash G.R. wrote:
> Can't you use ILaunchListener?
>
> - Prakash
--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
Phone +44 (01524) 510354
WWW http://www.steffen-zschaler.de/

--
Consider submitting to ECMDA-FA 2009, the 5th European Conference on
Model-Driven Architecture Foundations and Applications.
http://www.ecmda-fa.org/

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: How to wait for launches to finish [message #333982 is a reply to message #333968] Thu, 15 January 2009 09:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi Derek,

Yes, I assume in that case it would work as you are actually triggering
a build job. Unfortunately, a launch is not a build job (launch is
Eclipse's term for the "Run As..." stuff).

Many thanks anyway,

Steffen

Derek wrote:
> Well, all I can see is this works for me, although I use
>
> ResourcesPlugin.getWorkspace().build(buildType, monitor);
>
> rather than DebugUITools
>
> Steffen Zschaler wrote:
>> Hi Derek,
>>
>> Thanks for the quick reply.
>>
>> Comments below
>>
>> Derek wrote:
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> I am programmatically triggering a launch using
>>>> DebugUITools.launch(launchConfig, "run"). This will create a new
>>>> Job that invokes the actual corresponding LaunchDelegate. In my
>>>> code, I need to do more work once this Job is done.
>>>>
>>>> Unfortunately, it seems DebugUITools does not put this new Job into
>>>> any JobFamily. Therefore, I cannot use JobManager.join: Since the
>>>> code I am writing is in a Job itself, JobManager.join (null,
>>>> monitor) deadlocks. Is there any other way to wait for all Launches
>>>> to finish?
>>>>
>>>> Any hints would be greatly appreciated. Also, if this is the wrong
>>>> group, could you please direct me to the correct one?
>>>>
>>>> Many thanks in advance,
>>>>
>>>> Steffen
>>>>
>>> Have you tried:
>>> jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD,monitor) ;
>>> or
>>> jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD,monitor);
>> No, these did not seem to make sense, as the jobs seem to be
>> registered without a family. Specifically, somewhere deep in
>> Eclipse's logic dealing with launch configurations, it will
>> instantiate class Job overriding only run(), but not belongsTo().
>> This means, this job will not belong to any job family as far as I
>> understand it.
>>
>> I tried jobManager.join (null, monitor), but as I said above that
>> deadlocks as it essentially tries to join the job from which it calls
>> join...
>>
>> Best regards,
>>
>> Steffen
>>
>
>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
Phone +44 (01524) 510354
WWW http://www.steffen-zschaler.de/

--
Consider submitting to ECMDA-FA 2009, the 5th European Conference on
Model-Driven Architecture Foundations and Applications.
http://www.ecmda-fa.org/

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: How to wait for launches to finish [message #333990 is a reply to message #333981] Thu, 15 January 2009 12:08 Go to previous message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi,

Thanks again for the hint. Yes, ILaunchesListener2 helped quite well. Of
course in the process I found out that the specific launch I was
interested in would trigger another asynchronous Job that didn't have a
family, but that I also had to wait for. But IJobChangeListener helped
me with that one, so eventually things seem to be working as I expect
them to.

Many thanks again for the pointers!

Steffen

Steffen Zschaler wrote:
> Hi Prakash,
>
> That sounds like an interesting idea. I've just had a look at
> ILaunchListener. I cannot immediately see how to do it, I guess I'll
> have to try some things and report back.
>
> Many thanks so far,
>
> Steffen
>
> Prakash G.R. wrote:
>> Can't you use ILaunchListener?
>>
>> - Prakash

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
Phone +44 (01524) 510354
WWW http://www.steffen-zschaler.de/

--
Consider submitting to ECMDA-FA 2009, the 5th European Conference on
Model-Driven Architecture Foundations and Applications.
http://www.ecmda-fa.org/

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Previous Topic:[Databinding] Resetting targets after removing binding
Next Topic:UI Thread
Goto Forum:
  


Current Time: Wed Apr 24 15:52:44 GMT 2024

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

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

Back to the top