You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Michael McKibben <mi...@hihat.net> on 2001/12/01 22:11:51 UTC

[PATCH/SUMBISSION] ComponentStateValidator (was RE: [VOTE][Patch] ComponentUtil)

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:leo.sutic@inspireinfrastructure.com]
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:mike@hihat.net]
> 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>

Re: [PATCH/SUMBISSION] ComponentStateValidator (was RE: [VOTE][Patch] ComponentUtil)

Posted by Berin Loritsch <bl...@apache.org>.
Peter Donald wrote:

> Hi,
> 
> On Sun, 2 Dec 2001 08:11, Michael McKibben wrote:
> 
>>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.
>>
> 
> kool - added it into Excalibur projects until it stabilizes.


Keep it in Framework.  When it is ready, we release.


>>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
>>
> 
> That could work. WHats everyone think ?


It could work, BUT just how much overhead is there with bit-tests?


-- 

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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH/SUMBISSION] ComponentStateValidator (was RE: [VOTE][Patch] ComponentUtil)

Posted by Peter Donald <pe...@apache.org>.
Hi,

On Sun, 2 Dec 2001 08:11, Michael McKibben wrote:
> 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.

kool - added it into Excalibur projects until it stabilizes.

> 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

That could work. WHats everyone think ?

-- 
Cheers,

Pete

----------------------------------------------
Money is how people with no talent keep score.
----------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [PATCH/SUMBISSION] ComponentStateValidator (was RE: [VOTE][Patch] ComponentUtil)

Posted by Leo Sutic <le...@inspireinfrastructure.com>.

> -----Original Message-----
> From: Peter Donald [mailto:peter@apache.org]
> 
> On Mon, 3 Dec 2001 02:56, Leo Sutic wrote:
> > Now if a COMMITTER could just APPLY THE PATCH... :-)
> 
> oops - I completely missed that there was a patch attached to mail. Will 
> apply it now ...

I was actually referring to Michael's patch - but that was far from obvious...

Could you please apply the http://nagoya.apache.org/bugzilla/showattachment.cgi?attach_id=849
patch to Excalibur as well?

/LS


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH/SUMBISSION] ComponentStateValidator (was RE: [VOTE][Patch] ComponentUtil)

Posted by Peter Donald <pe...@apache.org>.
On Mon, 3 Dec 2001 02:56, Leo Sutic wrote:
> > -----Original Message-----
> > From: Michael McKibben [mailto:mike@hihat.net]
> > Sent: den 1 december 2001 22:12
> > To: Avalon Developers List
> > Subject: [PATCH/SUMBISSION] ComponentStateValidator (was RE:
> > [VOTE][Patch] ComponentUtil)
> >
> >
> > Also, I noticed when I refreshed cvs that AbstractComponent.java has some
> > compilation problems.
>
> I noticed this - it is taken care of in my patch from 2001-12-01 00:19
> GMT+1.
>
> Now if a COMMITTER could just APPLY THE PATCH... :-)

oops - I completely missed that there was a patch attached to mail. Will 
apply it now ...

-- 
Cheers,

Pete

---------------------------------------------------
Murphy's law - "Anything that can go wrong, will." 
(Actually, this is Finagle's law, which in itself 
shows that Finagle was right.)
---------------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [PATCH/SUMBISSION] ComponentStateValidator (was RE: [VOTE][Patch] ComponentUtil)

Posted by Leo Sutic <le...@inspireinfrastructure.com>.

> -----Original Message-----
> From: Michael McKibben [mailto:mike@hihat.net]
> Sent: den 1 december 2001 22:12
> To: Avalon Developers List
> Subject: [PATCH/SUMBISSION] ComponentStateValidator (was RE:
> [VOTE][Patch] ComponentUtil)
>
>
> Also, I noticed when I refreshed cvs that AbstractComponent.java has some
> compilation problems.

I noticed this - it is taken care of in my patch from 2001-12-01 00:19
GMT+1.

Now if a COMMITTER could just APPLY THE PATCH... :-)

/LS


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>