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


> equinoxÂ3.8.0.v20120529-1548

- Ray

On Mon, Apr 28, 2014 at 4:30 PM, BJ Hargrave <hargrave@xxxxxxxxxx> wrote:
You don't have to manage the instance. The framework, per spec, must cache the instance the return it for future BundleContext.getService calls.

I am quite sure Equinox is fine here. Never heard of a problem in this area. You don't mention what version you use.
--

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the
OSGi Alliance
hargrave@xxxxxxxxxx





From: Â Â Â ÂRaymond Auge <raymond.auge@xxxxxxxxxxx>
To: Â Â Â ÂEquinox development mailing list <equinox-dev@xxxxxxxxxxx>
Date: Â Â Â Â2014/04/28 16:24
Subject: Â Â Â Â[equinox-dev] bug or not
Sent by: Â Â Â Âequinox-dev-bounces@xxxxxxxxxxx





Hey all,

I have to write code as followsÂin a ServiceFactory impl in order for my factory to always return the same instance per bundle running on equinoxÂ3.8.0.v20120529-1548

===============================================

public HttpService getService(
Bundle bundle, ServiceRegistration<HttpService> registration) {

HttpServiceImpl httpServiceImpl = serviceMap.get(bundle);

if (httpServiceImpl != null) {
return httpServiceImpl;
}

httpServiceImpl = new HttpServiceImpl(
bundle, contextController, legacyServiceIdGenerator);

serviceMap.putIfAbsent(bundle, httpServiceImpl);

return httpServiceImpl;
}
===============================================

This seems clearly wrong as per the spec.Â


It's certainly calling the getService method of the ServiceFactory which I'm guessing means it's not incorrectly registered.

What could I be doing wrong? Was this ever a bug in equinox that was later resolved?


--
Raymond AugÃÂ(@rotty3000)
Senior Software Architect
Liferay, Inc.Â(@Liferay)
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev




--
Raymond AugÃÂ(@rotty3000)
Senior Software Architect
Liferay, Inc.Â(@Liferay)