At 04:36 PM 7/12/2002 +0200, you wrote:
>On Fri, Jul 12, 2002 at 11:56:02PM +1000, Peter Donald wrote:
> > At 03:26 PM 7/12/2002 +0200, you wrote:
> > >Hi Peter,
> > >
> > > One question, I just looked at DefaultComponentFactory, is the
> > > following analysis right:
> > >
> > > If I define a component suitable for use with a ServiceManager
> > > (also not implementing the Component interface) and try to look it
> > > up during service() on some other component, then won't the
> wrapped
> > > ComponentManger throw a ClassCastException during lookup() ?
> >
> > yep. All components hosted in ECM still have to implement Component
> however
> > now those components can be serviceable.
>
> *nod* no worries.
>
> Do you think it's worth adding a catch for ClassCastException ?
>
>try
>{
> final Object component = m_realManager.lookup( role );
> addUnreleased( component );
> return component;
>}
>catch( ClassCastException e )
>{
> throw new ServiceException(
> e.getRole(), "Servicables must implement Component", e
> );
>}
>catch( ComponentException e )
>{
> throw new ServiceException( e.getRole(),
> e.getMessage(),
> e );
>}
>
> or similar so the potential exception is handled explicitly ? (or
> won't ECM get that far anyway if the component doesn't implement
> Component ?)
No idea. I guess we could just in case ')
Cheers,
Peter Donald
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"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: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>