[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] bug or not

I meant for any service that maintains state for the duration of usage for each using bundle.  Luckily that is not common for the services that the OSGi specification defines.  HttpService is probably the most commonly used one that has to maintain state for using bundles.  Regardless of that, using a pattern that will constantly get/unget the same service over and over cannot perform as well as using some higher level API like SerivceTracker or declarative models like DS, or if you must use raw BundleContext APIs then caching it yourself.  If it is a rarely used service and you don't need it that often then I guess using the get/unget each time is not that costly, but it still does not seem like something we would want to recommend for services that are often used.  Regardless of how cheap it is to construct there is still more code you have to run to construct and get it each time.

Tom



Inactive hide details for Richard Hall ---04/28/2014 08:08:47 PM---If you only meant for registering resources with the HttpSerRichard Hall ---04/28/2014 08:08:47 PM---If you only meant for registering resources with the HttpService, then i can agree with that. :-)

From: Richard Hall <heavy@xxxxxxxxxxxxxx>
To: Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
Date: 04/28/2014 08:08 PM
Subject: Re: [equinox-dev] bug or not
Sent by: equinox-dev-bounces@xxxxxxxxxxx





If you only meant for registering resources with the HttpService, then i can agree with that. :-)

-> richard

On Apr 28, 2014 8:59 PM, "Thomas Watson" <tjwatson@xxxxxxxxxx> wrote:

GIF image