Hi Huan,

When you're calling ServiceLoader.load(Class, ClassLoader) you are already
explicitly specifying an actual classloader. So you should not need to use
Aries SPI-Fly at all, but just need to ensure that the classloader provided
is the right one. SPI Fly (and the OSGi ServiceLoader Mediator spec) is
about handling the implicit classloader used with ServiceLoader.load(Class).

If for some reason you the code that calls ServiceLoader.load(Class,
ClassLoader) is not passing the right classloader then I think the best way
would be to fix that code.
I guess SPI Fly could support a scenario like this but it would mean that
existing actual code is changed, rather then additonal code inserted. I'm
not too sure if that is really the best thing to do, but if there is a need
for it then I think it could be considered as an addition, if someone
proposes a patch...

Cheers,

David



On 24 July 2017 at 12:46, <[email protected]> wrote:

> Hi,
>
> I'm trying to covert io.grpc.* library to OSGI bundle and I'm using aries
> spi-fly to resolve service loader problem. But It seems that ASF can not
> work if the jar use load(class, classloader) api. I found some
> mail-pipeline about this problem in 2013:
>
> http://mail-archives.apache.org/mod_mbox/aries-user/201310.mbox/browser
>
> I'd like to know is there any way to resolve this problem now?
>
>
> Thanks!
>
>
> 宦林英 Huan Linying
>
>
> 南京协议开发三部/有线研究院/有线产品经营部 Nanjing Protocol Development Dept. III/Wireline
> Product Operation Division
>
>
>
> 南京市雨花台区紫荆花路68号
>
> Nanjing city Yuhuatai District Bauhinia Flower Road No.68
> M: +86 13182845505 <+86%20131%208284%205505>
> E: [email protected]
> www.zte.com.cn
>

Reply via email to