You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Joerg Heinicke <jo...@gmx.de> on 2005/08/14 21:52:13 UTC

[jci] initial compiling

Hello,

I have a problem with loading a class immediately after the setup of the
CompilingClassLoader. With a setup like in the TestCases using a signal object
it does not work (I get ClassNotFoundException), because the CCL does release a
reload() event immediately after setup - before my files have been compiled.

Removing the reload() from the last line of start() in the CCL seems to be the
correct way. The CCL is waiting for the CompilingListener then and does release
a reload() event after compiling is finished. The problem seems to be an initial
empty directory, because in this case the CompilingListener does not release the
reload() event.

But with the two reload()s I can not distinct between the events (just wait for
the second reload() sounds not really reliable). So I need either access to the
CompilingListener to get informed about the finished compiling or the reload()
must send information about the type of event (like the ActionListeners in AWT).

But IMO this should be fixed in the CompilingListener without the reload() in
CCL as there is no difference in starting with an empty directory or later
emptying a directory.

Do I have missed something?

WDYT?

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [jci] initial compiling

Posted by Torsten Curdt <tc...@apache.org>.
>>> The "hasReloaded" notification should
>>> happen after the compilation has finished and your classes
>>> should be available after that.
>>>
>>>
>>
>> As I wrote above the first "hasReloaded" happens already by the  
>> CCL itself at
>> the end of its start() method. The second "hasReloaded" is the one  
>> to go at the
>> moment. But this looks more like a bug than a reliable feature.
>>
>
> Ahhh ...yes, the reload() in the start() method
> sounds wrong. Will look into this later today.

Should be fixed :)

cheers
--
Torsten

Re: [jci] initial compiling

Posted by Torsten Curdt <tc...@apache.org>.
>> The "hasReloaded" notification should
>> happen after the compilation has finished and your classes
>> should be available after that.
>>
>
> As I wrote above the first "hasReloaded" happens already by the CCL  
> itself at
> the end of its start() method. The second "hasReloaded" is the one  
> to go at the
> moment. But this looks more like a bug than a reliable feature.

Ahhh ...yes, the reload() in the start() method
sounds wrong. Will look into this later today.

cheers
--
Torsten


Re: [jci] initial compiling

Posted by Joerg Heinicke <jo...@gmx.de>.
Torsten Curdt <tcurdt <at> apache.org> writes:

> > I have a problem with loading a class immediately after the setup  
> > of the CompilingClassLoader. With a setup like in the TestCases using a  
> > signal object it does not work (I get ClassNotFoundException), because the
> > CCL does release a reload() event immediately after setup - before my files
> > have been compiled.
> 
> Why would you expect the classes be available right away?
> It's an asynchronous process. But maybe explain your
> environment a bit more.

That's absolutely clear. I have a setup like in the TestCases with a signal
object waiting for the reload signal. But the first reload signal is released by
the CCL itself without waiting for the compiling. And IMO this is wrong.

> If the files are already on disk the start of the CL
> should start the fam that will trigger the compilation
> after the first run.

Yes, it does. But at the same time it releases a "hasReloaded" event - before it
is actually setup correctly.

> The "hasReloaded" notification should
> happen after the compilation has finished and your classes
> should be available after that.

As I wrote above the first "hasReloaded" happens already by the CCL itself at
the end of its start() method. The second "hasReloaded" is the one to go at the
moment. But this looks more like a bug than a reliable feature.

> Please try the latest version and report back.
> I did some substantial changes over the weekend.

Still the same like on Friday.

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [jci] initial compiling

Posted by Torsten Curdt <tc...@apache.org>.
> I have a problem with loading a class immediately after the setup  
> of the
> CompilingClassLoader. With a setup like in the TestCases using a  
> signal object
> it does not work (I get ClassNotFoundException), because the CCL  
> does release a
> reload() event immediately after setup - before my files have been  
> compiled.

Why would you expect the classes be available right away?
It's an asynchronous process. But maybe explain your
environment a bit more.

There is a bug in the listener behavior for the
ReloadingClassLoader (it would require to signal
the stop, not the reload. see the FIXME inside the code)
but thats fine for the CCL.

If the files are already on disk the start of the CL
should start the fam that will trigger the compilation
after the first run. The "hasReloaded" notification should
happen after the compilation has finished and your classes
should be available after that.

Please try the latest version and report back.
I did some substantial changes over the weekend.

cheers
--
Torsten