Sure. We can update ServiceFactory.getService javadoc to add information on the fired FrameworkEvents. It already states that null is returned to the caller. --
BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance [email protected] office: +1 386 848 1781 mobile: +1 386 848 3788 From: Holger Hoffstätte <[email protected]> To: [email protected] Date: 2011/01/26 08:40 Subject: Re: [osgi-dev] ServiceFactory vs. exceptions Sent by: [email protected] BJ, Thanks! That was precisely what I was looking for. I don't think this is spelled out anywhere in detail in either the spec or the javadocs; the latter don't really say anything useful at all (IMHO). Should I file an enhancement bug to add this explanation? I know I'm not the only one wondering about this. Holger On 26.01.2011 14:14, BJ Hargrave wrote: > If the factory returns null, a FrameworkEvent.ERROR will be fired with a > ServiceException.FACTORY_ERROR. > > If the factory throws an exception, a FrameworkEvent.ERROR will be fired > with a ServiceException.FACTORY_EXCEPTION. The exception thrown from the > factory will be the cause of the ServiceException. > > In both cases, BundleContext.getService will return null to the caller. > The caller will not be thrown an exception. > > So I would let the exception propagate from the factory and let the > framework handle it. _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
