You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Zeng Eyindanga Landry stephane <la...@bull.net> on 2010/10/29 16:04:19 UTC

Allow to initialize a class when it is loaded.

Hello,
I'd like to initialize the class when a bundle loads it, which is 
equivalent to Class.forName(clzName, initialize, classLoader).
Actually this is not possible using the Bundle Api. Unfortunately(for 
me), felix never initializes a class when loading it, e.g Class.forName 
is invoked with the initialize parameter set to false.

Could felix provide such functionnality ? May be the specs can also evolve ?

Stephane Z.



Re: Allow to initialize a class when it is loaded.

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Looking into this and discussing it some more, it doesn't look like this 
is something we could support, nor can I yet think of a good reason for 
doing it.

It appears the only way to initialize a class is with Class.forName(), 
but we don't use that mechanism.

-> richard

On 10/29/10 12:34, Richard S. Hall wrote:
> On 10/29/10 10:04, Zeng Eyindanga Landry stephane wrote:
>> Hello,
>> I'd like to initialize the class when a bundle loads it, which is 
>> equivalent to Class.forName(clzName, initialize, classLoader).
>> Actually this is not possible using the Bundle Api. Unfortunately(for 
>> me), felix never initializes a class when loading it, e.g 
>> Class.forName is invoked with the initialize parameter set to false.
>>
>> Could felix provide such functionnality ? May be the specs can also 
>> evolve ?
>
> First, let me ask why?
>
> Second, is this something you want to configure on a per bundle basis 
> or is it just a global configuration?
>
> -> richard
>
>>
>> Stephane Z.
>>
>>
>>

Re: Allow to initialize a class when it is loaded.

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 10/29/10 10:04, Zeng Eyindanga Landry stephane wrote:
> Hello,
> I'd like to initialize the class when a bundle loads it, which is 
> equivalent to Class.forName(clzName, initialize, classLoader).
> Actually this is not possible using the Bundle Api. Unfortunately(for 
> me), felix never initializes a class when loading it, e.g 
> Class.forName is invoked with the initialize parameter set to false.
>
> Could felix provide such functionnality ? May be the specs can also 
> evolve ?

First, let me ask why?

Second, is this something you want to configure on a per bundle basis or 
is it just a global configuration?

-> richard

>
> Stephane Z.
>
>
>