You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/08/10 14:50:11 UTC
[VOTE] Re: ComponentManager.release
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
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: [VOTE] Re: ComponentManager.release
Posted by Berin Loritsch <bl...@yahoo.com>.
> One thing though ... what is meant to happen when we
> get handed a component
> that we don't manage - ignore it ?
YES. That was always the intention.
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: [VOTE] Re: ComponentManager.release
Posted by Peter Donald <do...@apache.org>.
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