Alan,
I think that we should start by steps, and I'm sure we'll find a few
problems in the first refactorings. Then we'll have some concrete things
to talk about and to decide.
Removing Avalon is like removing the "concurrency.jar" framework: it is
a framework and not "container code". If you want to remove it you have
to replace it with something else.
One example:
Disposable is an Avalon interface meaning the object has a "dispose()"
method that should be called when disposing it.
Our MimeMessageWrapper depends on this dispose() method being called.
MailImpl objects have references to MimeMessageWrappers and are
Disposable too. When we destroy MailImpls we call
ContainerUtil.dispose(mail) or if you prefer we write this code:
--
if (mail instanceof Disposable) ((Disposable) mail).dispose();
--
To remove the Disposable interface you have 2 options:
1) clone the Disposable interface in a james package and keep the same
behaviour code (change only the import)
2) change the whole behaviour/pattern used.
That said, about the 2 solutions:
1) I'm currently AGAINST this code cloning: I don't get the advantages
of cloning the avalon.jar code to the james sources. I would switch to
custom interfaces ONLY if we need different interfaces.
2) This kind of pattern is used in many places in James: btw, how would
you change it?
If you want to find out where we use this pattern you should search for
"ContainerUtil" in James sourcecode.
ContainerUtil is an avalon utility that simply call the method only when
the object implements the given interface.
ContainerUtil.configure(Object object, Configuration config)
is the same as
if (object instanceof Configurable) {
object.configure(config);
}
The same for the other ContainerUtil methods.
Stefano
Alan D. Cabrera wrote:
While my understanding as to the functionality of Avalon and Phoenix may
not be accurate, I've had plenty of experience with embedding
Avalon-ized servers and it has been horrible. Maybe it's the fault of
of the projects that used it. I just would not want to subject the
developers who want to embed James to the same thing I went through.
Please take a look at OpenORB. Maybe they abused Avalon. Maybe, my
wife says more likely, I didn't properly understand what's going on.
I buy the concepts that you mention above. I'm not sure that we have to
use Avalon to get the job done.
I'm going to take your advice and start tinkering w/ James.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]