avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: [VOTE] Re: ComponentManager.release
Date Fri, 10 Aug 2001 13:00:10 GMT
On Fri, 10 Aug 2001 22:50, Berin Loritsch wrote:
> Leo Sutic wrote:
> > All,
> >
> > is it part of the contract for ComponentManager.release that the
> > component parameter may be null?
> >
> > In ExcaliburComponentManager.release the method has a test at the top:
> >
> >   if ( null == component )
> >   {
> >       return;
> >   }
> >
> > So one can write:
> >
> > MyComponent myComponent = null;
> > try {
> >     myComponent = manager.lookup (MyComponent.ROLE);
> >     ...
> > } finally {
> >     manager.release (myComponent);
> > }
>
> You know what?  This has never been formalized as a proper use, but I like
> it. I put that test in there because I wanted to exit the function early if
> there was nothing to do.
>
> I propose that we enforce this as part of the contract for
> ComponentManager/Selector so that we can return a null and the manager will
> ignore the request.
>
> +1

works for me too

+1

One thing though ... what is meant to happen when we get handed a component 
that we don't manage - ignore it ?

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*

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


Mime
View raw message