felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Snorre Lothar von Gohren Edwin <snorre.ed...@gmail.com>
Subject Re: ServiceTracker problems
Date Wed, 22 May 2013 14:30:04 GMT
Ahh thank you very much! It solved it.
Do you mind explaining the reason for this?
Im in the learning fase:)


On Wed, May 22, 2013 at 4:25 PM, Chetan Mehrotra
<chetan.mehrotra@gmail.com>wrote:

> Try to modify the addingService in TrackerImpl and instead of returning
> null delegate the call to parent
>
> @Override
> public Object addingService(ServiceReference ref) {
> System.out.println("Added a service with snorre");
> button = new ServiceButton(ref);
> button.addActionListener(new ButtonActionListener(frame, ref));
> frame.addToolBarButton(button);
> frame.addServiceToList(ref.getBundle().getSymbolicName());
> return super.addingService(ref);
> }
>
> That you get the expected flow working
>
> Chetan Mehrotra
>
>
> On Wed, May 22, 2013 at 7:37 PM, Snorre Lothar von Gohren Edwin <
> snorre.edwin@gmail.com> wrote:
>
> > Hi, im new to OSGi and using the felix framework.
> > My code can be found here:
> https://github.com/Snorlock/prosjektoppgavekode
> >
> > My problem is that the removedService method is never called when a
> service
> > is stopped.
> > The servicetracker implementatition can be found here:
> >
> >
> https://github.com/Snorlock/prosjektoppgavekode/tree/master/org.snorre.roadstation/src/org/snorre/roadstation/impl
> >
> > Im not using the customizer, just tried to use it to see if that solved
> the
> > problem.
> >
> > The activator can be found here:
> >
> >
> https://github.com/Snorlock/prosjektoppgavekode/tree/master/org.snorre.roadstation/src/org/snorre/roadstation/internal
> >
> > And a service that is beeing registerd can be found here:
> >
> >
> https://github.com/Snorlock/prosjektoppgavekode/tree/master/org.snorre.service.sign/src/org/snorre/sign/internal
> >
> > So the thing is that addedService is beeing called everytime the service
> > bundle is started, but for some reason I cant get the removedService to
> get
> > called when I stop the service bundle. So basically my gui gets
> repetative
> > buttons because it never registers that a service is gone.
> >
> > I dont know what is wrong and dont know how to debug this.
> > Im trying this maillist to see if someone might help.
> > Thx in advance.
> >
> >
> > --
> > Mvh
> > Snorre Lothar von Gohren Edwin
> > +47 411 611 94
> >
>



-- 
Mvh
Snorre Lothar von Gohren Edwin
+47 411 611 94

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message