> -----Original Message-----
> From: Rajamani Saravanan [mailto:rajamani.saravanan@gmai...]
> Sent: 28 September 2004 19:13
> To: Avalon framework users
> Subject: Ability to configure a single classloader model
> I am facing an issue with having multiple classloaders - very much
> related to one of my earlier posts - but in a slightly different
> manner (the previous post was with a JNDI lookup throwing a NCDFE..) -
> basic question is this : is there any way I can specify that Merlin
> should share classloaders among blocks (I understand the reason behind
> having partitioned classloaders but the chain is causing too much
In prinicipal you should not be having any classloader problems. The
classloader chain from the framework api downwards reflects you
specification of blocks in the block hierarchy. If you want to share
particular classes then they need to be in a block higher in the
hierarchy that the consumer classes.
> ..I have a component exports an initialization service - this does a
> Class.forName() on some UI controls (these controls can't be Avalon
> components, but the component that does the initialization is the one
> entrusted with this responsibility).. This is requiring all such
> controls to be loaded into the initial block itself - when ideally,
> the actual modules may have controls local to themselves... If I embed
> an instance of the initializer into the module's block, things are
> fine (the module's classloader finds the class correctly) - but this
> would mean that each of the module will get their own instance of the
> initializer... ideally the initializer should be shared...
Presumably an initializer is initializing something that is a supplied
argument. The instance to be inialized can be based on a class that is
private to a particular block providing that the initialization service
is higher up in the block hierarchy.
> Related issue : is there anyway I can detect an artifact being
> downloaded by Repository? (Something like KernelEvent - is there a
> RepositoryEvent?) ..or is there a way that I can query the Repository
> for meta information about an artifact?
There are no repository events at this time - but it's an area of
interest. Concerning quires - you can use the repository to load an
artifact and you can test if there is a .meta assigned to the artifact.
This will allow you to get the properties object that is the external
form of the meta data but you would need to build up a data model
Exposing addition services related to the repository is something we are
looking at the moment concerning the 'transit' package.