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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]