avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: Mutually dependant blocks / classload problem
Date Sun, 22 Jul 2001 13:13:04 GMT
On Sun, 22 Jul 2001 23:09, Paul Hammant wrote:
> Folks,
> I have two blocks DestopKernel and WindowManager (implemented by
> DestopKernelImpl and WindowManagerImpl),  Under Avalon control the Kernel
> depends on the Window Manager, then registers itself back, so that API
> calls can be made both ways.  They are both zipped into the same .bar file
> so there are no class loading problems...
> It feels wrong though.  They should be separate .bar files in the same .sar
> file.  The problem is that interfaces wil be required to be blundled with
> both bar files and therefore loaded by two different classloaders.  When
> that happens they will no longer be the same interface... and a class
> loading error will result :-(

In older versions of phoenix this used to be true. In newer versions the 
whole .sar is kept in one ClassLoader. The main reason for this change is 
that I wanted to match the .war approach as closely as possible because then 
skills in one should be transferable to another. The .war approach also has a 
lot more knowledge put into it that we can ... errr borrow ;)

> Is there a way, given the interface/implementation nature of these non core
> blocks, to specify two mutually dependant blocks, in such a way that there
> will not be a classloading error?

As long as they are in the same .sar they should be fine ... however it is 
probably best not to have them mutually dependent. The reason is that the 
work interface should never be exposed until after the block has 
initialized/started. In fact I thought I made it so that the DAG threw an 
exception if it found circular dependencies (though I may have taken that 



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

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

View raw message