Okay, I've attached an implementation called ComponentStateValidator.java
that basically does what ComponentUtil and AbstractComponent does. I didn't
patch ComponentUtil because I noticed that it has been removed from the cvs
tree. Feel free to move/rename it to whatever makes sense.

Also, I noticed when I refreshed cvs that AbstractComponent.java has some
compilation problems. It still has two old references to
ComponentUtil.checkActive(...) instead of the protected member method. You
probably didn't notice it because you still had the old ComponentUtil class
in your local tree.

I was also thinking that maybe in the future this could be enhanced to
switch off the validation, for example a static debug flag initialized via a
property like

static {
        debug = Boolean.getBoolean("org.apache.avalon.framework.someproperty");
}

then the check*** methods would be wrapped with an if test

if (debug)
{
// validate component state ...
}

Another idea is to use JDK 1.4 assertions.

Regards,

--mike

-----Original Message-----
From: Leo Sutic [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 01, 2001 7:16 AM
To: Avalon Developers List
Subject: RE: [VOTE][Patch] ComponentUtil


Michael,

true. That would be even better and provide something similar to the
impossible multiple inheritance that I would see as the optimal solution.

Could you implement & submit a patch - maybe we can get it into framework
4.2 or 4.1.1. Berin?

/LS

> -----Original Message-----
> From: Michael McKibben [mailto:[EMAIL PROTECTED]
> Sent: den 1 december 2001 01:05
> To: Avalon Developers List
> Subject: RE: [VOTE][Patch] ComponentUtil
>
>
> One way to accomplish what you are trying to do is to make the state java
> object, e.g. ComponentState, that has instance methods for validating the
> component's state.
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Attachment: ComponentStateValidator.java
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to