Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to start a service from FinalLaunchSequence?

I need to create some additional services, so this is why I need access to the services factory, and not just to the tracker (which tracks existing services).
--
Subs




On 5 Jul 2011, at 14:27, Andy Jin wrote:

> I didn't realize you can get service from the launch because launch is not a parameter to the FinalLaunchSequence. I always use the "DSFServicesTracker" class to get the services (backend, control, process, etc.). Here is what I do:
> 
> DsfServicesTracker serviceTracker = new DsfServicesTracker(<MYPLUGINACTIVATOR>.getBundleContext(), dsfSession.getId());
> serviceTracker.getService(<service_interface>);
> 
> while <service_interface> can be IGDBBackend.class, IGDBControl.class, IMIProcess.class...
> 
> "dsfSession" is a parameter to the FinalLaunchSequence.
> 
> Make sure you don't use concrete service classes but use their interface so whoever extends your class can use their own version of service.
> 
> Regards,
> Andy
> 
> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Branko Dreven?ek
> Sent: July-05-11 8:03 AM
> To: cdt-dev@xxxxxxxxxxx
> Subject: Re: [cdt-dev] How to start a service from FinalLaunchSequence?
> 
> On 07/05/2011 01:24 PM, Derek Morris wrote:
>> I should have pointed out that I am using CDT 8 (Indigo) and:
>> - according to Bug 326951 (comment 36) you should now create services in FinalLaunchSequence
> I was not aware of this. Oh well. (Also using Indigo, but extending jtag 
> launchers which are seemingly outdated).
>> - at the point that FinalLaunchSequence is created, the launch isn't available - at least I can't find it...
> Checked it. It's not there by default, but in default implementation 
> DsfSession is. So something like this:
> 
>         GdbLaunch launch = (GdbLaunch)getSession().getModelAdapter(ILaunch.class);
> 
> 	launch.getServiceFactory().
> 
> You have to crate getSession().
> 
> Regards.
> Branko
> 
>> --
>> Subs
>> 
>> 
>> 
>> 
>> On 5 Jul 2011, at 11:55, Branko Drevenšek wrote:
>> 
>>> Hi.
>>> 
>>> If you get GdbLaunch "launch" as parameter to your FinalLaunchSequence, you can then say something like launch.getServiceFactory().
>>> BTW: As far as I studied DSF you should probably create services in ServicesLaunchSequnce.
>>> 
>>> At least that's how I do it (not sure if this is the supposed way).
>>> 
>>> Regards.
>>> Branko
>>> 
>>> On 07/05/2011 12:46 PM, Derek Morris wrote:
>>>> Hi,
>>>> 
>>>> I am trying to start (create) a service from within my (overriden) FinalLaunchSequnce, but I can't find how to get the servicesFactory? Any ideas?
>>>> 
>>>> Thanks
>>>> --
>>>> Subs
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> cdt-dev mailing list
>>>> cdt-dev@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>> _______________________________________________
>>> cdt-dev mailing list
>>> cdt-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> _______________________________________________
>> cdt-dev mailing list
>> cdt-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top