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

Reply via email to