johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Dev <hendrikde...@gmail.com>
Subject Re: Few thoughts and questions on javax.json.spi.JsonProvider (geronimo spec)
Date Tue, 21 Apr 2015 22:01:45 GMT
On Tue, Apr 21, 2015 at 11:06 PM, Romain Manni-Bucau
<rmannibucau@gmail.com> wrote:
> Le 21 avr. 2015 22:51, "Hendrik Dev" <hendrikdev22@gmail.com> a écrit :
>>
>> A few thoughts and questions on
>>
>> JsonProvider.doLoadProvider():
>> - "tccl" can be null (in case of system classloader) but thats never
>> really checked
>
> If so johnzon cant be loaded isnt it? So not a big deal imo

someone could set the context classloader explicitly to null, see attached diff

>
>> - special handling org.apache.geronimo.osgi.locator.ProviderLocator
>> really needed here?
>>
>
> In G spec jars yes.

OK

>
>> JsonProvider.provider():
>> - doPrivileged/SecurityManager check really needed here?
>
> For containers yes and doesnt hurt at runtime normally.

OK

>
>> - method seems thread safe but we do not cache the returned provider
>> instance. Maybe we can to this in a thread local variable?
>>
>
> Not cached for container case + i dont expect it to be called often.
>
> Thread local would break ears or wars if johnzon is in one war, jackson in
> another and api in the container for instance + it would leak on undeploy.

i see, so maybe caching the hole provider, see attached diff

>
> Did you hit any issue?

nothing special, originally working on that to make sure that Johnzon
is working under OSGi (Karaf), so i looked at the RI and johnzon
specs.

>
>> Thanks
>> Hendrik
>>
>> --
>> Hendrik Saly (salyh, hendrikdev22)
>> @hendrikdev22
>> PGP: 0x22D7F6EC



-- 
Hendrik Saly (salyh, hendrikdev22)
@hendrikdev22
PGP: 0x22D7F6EC

Mime
View raw message