BUG Community

Welcome! Log In

Forums BUG SDK OSGI ServiceTracker versus BugLabs AbstractServiceTracker

Subscribe to OSGI ServiceTracker versus BugLabs AbstractServiceTracker  7 posts, 4 voices

Log in to reply to this topic
 
Oct 13, 2007 2:18am
Medium Bug Labs team finsprings 268 posts

I’m a little confused by the name of the AbstractServiceTracker. It extends the ServiceTrackerCustomizer and IServiceProvider interfaces, so I don’t really get how it’s a service tracker itself. In the sample apps the OSGI ServiceTracker is constructed from a Filter that’s built via the getServices method of the AbstractServiceTracker, and also from the AbstractServiceTracker itself in its guise as a ServiceTrackerCustomizer.

I wonder if we could do away with the user having to extend this AbstractServiceTracker, class at all by making it not abstract and having its constuctor take the list of services the user’s app wanted along with a handle to an interface for the app so it could call back to the app to start and stop it. That way the user’s app class could just implement that start/stop interface and the activator could own the app object and instantiate NonAbstractServiceTracker with that object. This is basically what each sample app’s FooServiceTracker is doing anyway; I’m just wondering if we can take that one extra step.

Just a thought anyway.

Oct 15, 2007 8:55am
Medium Bug Labs team kgilmer 215 posts

Finsprings,

I don't really get how it's a service tracker itself.


You are correct, it's a customizer. I think at the time the idea was that adding Customizer would make the class name really long. The class could use a better name.

I wonder if we could do away with the user having to extend this AbstractServiceTracker


Yes! You do not need to rely on this class whatsoever. The structure of the class was designed for our code generator, not the end user. In any case our code generator adopts an "all or nothing" view of service dependencies and is only suitable in simple cases.

...so it could call back to the app to start and stop it.


Do you mean start()/stop() in Activator? These are called (owned) by the OSGi runtime. Another set of methods would have to be defined.

In general, you are right, there are many ways this could go. We'd love to see your ideas! FYI, here are some OSGi approaches that can be used rather than ServiceTracker. Be aware though that we use an OSGi R3 implementation, and these are R4+ (AFAIK).

1. Service Activator Toolkit: http://www.eclipse.org/ohf/components/soda/index.php

2. OSGi Dynamic Services:
http://www.eclipsezone.com/eclipse/forums/t96740.html
Oct 15, 2007 10:09am
Medium Bug Labs team finsprings 268 posts

Sorry, I guess I wasn’t clear. I meant to propose extending AbstractServiceTracker so that its doStart/doStop methods would call (via a new interface) my app object’s start and stop methods. This is what the examples pretty much do, just not canned like I’m suggesting.

So on startup:
1) the activator instantiates the app object.
2) the activator instantiates the [Non]AbstractServiceTracker, passing it the app object (as a handle to an app interface, ie not as a handle to my specific app-class)
3) the activator starts up the service trackers
4) when the [Non]AbstractServiceTracker’s doStart method gets called (once its canStart returns true), it calls appHandle.start
5) when the [Non]AbstractServiceTracker’s doStop method gets called it calls appHandle.stop

Let me know if I’m still not making sense.

Oct 15, 2007 1:41pm
Medium Bug Labs team kgilmer 215 posts

finsprings,

Ok, I understand. Yes, that would be a good approach. So the difference being that an IBUGApplication interface would be created that essentially mirrors the Bundle interface. It may even make sense to put the STC in as an internal class to the Activator, so there is only one class created. I’m a big fan of simple.

Oct 15, 2007 2:10pm
Medium Bug Labs team finsprings 268 posts

Right. The less boiler plate that needs to be cut and pasted to get the average app going, the better. If you can combine a default STC into the Activator that would be even cleaner.

As long as there’s a way to override that behavior by specifying your own customizer, tracker, whatever, then you leave the door open for the experienced user trying to do something more unusual while still making it as simple as possible for the average user just trying to knock something together quickly.

Aug 14, 2012 2:10am
User_img_not_found_06_med rubing 103 posts

Isn’t it funny how we www.coachfactorystoreec.com/ Coach Factory Store always want what we can’t have? The girl with the round and pert backside wishes that her rear were 5 times smaller. Meanwhile, the girl with the non existent posterior wishes to achieve a larger butt. Well, if the grass is greener on the other side, just water yours! If you’ve got a small behind, you can create the illusion of a larger one with butt enhancing jeans. Here’s how to do it. Look for light weight denim – This material is very stiff and heavy. If you try to stuff a flat butt into denim jeans, it will only create a flatter looking behind. A little stretch goes a long way – Your butt enhancing jeans should additionally contain some stretch. A mixture of 98 percent cotton and 2 percent lycra is best. This combination of lycra and cotton, especially when it’s in a nice tight-weave fabric that’s fitted through the hip and thigh area will help lift your buttocks. Too much lycra and your jeans may start to ripple like a pair of leggings. If there’s not enough cotton content, there won’t be enough structure to hold you up. It’s all in the pockets – The most effective trick for creating the illusion of a bigger butt is to choose jeans with flap pockets. The added bulk of the flap will enhance and add dimension to your tiny tush. True Religion is notoriously famous for their flap pocket designs. You can also try Hudson, Rock & Republic, Frankie B and Paige for addition flap pocket styles. Pocket placement – If you’re not a fan of flap pockets, or if you’ve already bought too many of them, you can also try denim with regular pockets. Be sure to aim for a pair with smaller pockets that sit higher and this will help make your rear look lifted. Cut is also important – Look for jeans with a slight tapering at www.coachfactoryonliness.com/ Coach Factory Online the knee, such as a straight leg or skinny style. This cut will make your bum look a bit larger in comparison to the rest of your body. Great styles to try are True Religion Billy, Julie or Stella, Siwy Harmah or Rose, and Hudson Emily or Paige. How low can you go – Actually, you don’t want to go too low when it comes to the jean rise. The goal is to project more, not less. A pair of low rise denim will only reduce the size of your rear. Instead, opt for a pair with a medium rise. Color me right – Since dark colors minimize, dark denim and indigo will create a slimming effect. You do not want this kind of effect on your barely there behind! Try to find light colored or medium blue denim. Grey is very flattering and will also work. Like a great bra, butt enhancing jeans can also lift and www.coachfactoryoutletusa.com/ Coach Factory Outlet separate what little you have. So it wasn’t in your genes to have a nice, round bottom. Big deal. Be happy with what you’ve got and just improvise!

Oct 3, 2012 2:33am
User_img_not_found_02_med wunai 103 posts

Thanks to the answers was possible to Tods shoes evaluate the intensity of use and the question of the distinction in purchasing. Women need a bag to carry their belongings, that’s for sure. Leather bags, women nowTods UK  have the flexibility and class beyond what I ever thought. The serious fashion lovers will love the leather bags thanks to its versatility, high quality and elegant style. With brands like Tod tods women shoes, Cole Haan,Tods Outlet   Rebecca Minkoff, among many others, is nothing but leather bags and upscale beyond amazing. Hogan shoes outlet The design is based on a conceptLouis Vuitton UK of minimal interference between your feet and the floor.

Log in to reply to this topic
Forums BUG SDK OSGI ServiceTracker versus BugLabs AbstractServiceTracker