avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: component factories...
Date Wed, 02 Jan 2002 20:25:34 GMT
Neeme Praks wrote:

> Question about component management in Excalibur:
> When I need to do dynamic class loading with
> classloader.loadClass(className).newInstance(), should I do this with my
> code or should I just use ComponentManager for this also? What is the "best
> practice"?
> FYI, I'm trying to find the best way to implement
> org.apache.avalon.excalibur.i18n.DefaultBundleFactory (in scratchpad).
> Right now it does it like this:
> Thread.currentThread().getContextClassLoader().loadClass(bundleClassName).ne
> wInstance();
> And then manages the lifecycle methods...
> However, I would like Excalibur to take care of that and the lifecycle
> methods. Is it ok, if I just require the user to declare all the different
> bundle implementations and then ask for instances from
> ExcaliburComponentSelector? Or is it a bit of abusing the
> ExcaliburComponentSelector, if I use it like this (as a factory)?

I want to get back to working on the container abstraction code.  I want to
separate out the Container code from ExcaliburComponentManager, and have it
as it's own entity.

This includes the ComponentHolder stuff, role management, etc.  It also is the
configuration stuff.  I want to get back to the ComponentManager being strictly
a role to component matching interface.

If the Bundles you are instantiating are not Components (as I suspect is the
case), you may want to adapt the ComponentHolder concept for yourself.  Or,
if you relax the ComponentHolder implementation code so as to work with any
object that uses Lifecycle management, it would work with both Bundles and


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

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

View raw message