avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen McConnell" <mcconn...@osm.net>
Subject RE: Divergence from Avalon (was Re: [RT] Is Poolable Harmful?)
Date Thu, 10 Jan 2002 17:08:57 GMT

Peter Royal wrote:
> On Thursday 10 January 2002 10:47 am, Stephen McConnell wrote:
> > > On a side note, I always re-throw any ComponentException's as
> > > RuntimeException's, what do other folk do?
> >
> > I generally rethrow a qualified ComponentException (qualified in
> > that it has meaningful context in the exception message).
> Do you wrap them in a RuntimeException or do you have "throws 
> ComponentException" on many methods?

No many - generally speaking the work in done in the initialize4 method
but on occasions there is extraction and repacking of components 
provided by a compooinent that is itself a container.  In 
these cases the component reshuffling code generally throws a 
Componnet exception along the lines of ...

   // inside contextualize

      // do component composition stuff
   catch( ComponentException e )
      final String error = "some context relevant message";
      throw new ComponentException( error, e );

About the only reason for choosing this approach is that 
ComponentException is declared and documented - as opposed to 
RuntimeExceptions which are less likely to get documented.

Cheers, Steve.

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

View raw message