commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <>
Subject Re: [Lang] Generic interface for handling exceptions
Date Wed, 31 Jul 2002 13:16:40 GMT

It has meaning to have this interface in lang if it defines some "contract"
for error handling :

  someInstanceFromLang.registerErrorHandler( myHandlerImpl );

If no "contract" defined it is no meaning to have "callback" interfaces.

And no need to have "general" interface, it is always possible to use
"addapter" :

class MyErrorHanler implements SAXErrorHandler, MyErrorHandler,
RMIErroHandler .....
  void handleXXX( XXX error ) {


 void handleAll( Throwable t ){


> > -----Original Message-----
> > From: Henri Yandell []
> > My immediate thoughts are that it doesn't really add any
> > functionality to Lang, just a standardised interface.
> How about just putting it in lang/exception?
> > As far as users are concerned, I would normally expect to use Log4J or
> > something in this kind of area.
> But logging is just one instance of event handling (i.e. you handle a
> "throwable event" typically by logging it, but you needn't).  I'd rather
> have my objects be decoupled entirely (or as close to entirely as
> from *any* logging system, and simply fire events (such as this) instead.
> > Maybe it's a feature which could be added to commons-logging?
> Well, except logging is Something You Do In Response To An Event.  In
> itself, the catching of a Throwable is not tightly bound to logging (maybe
> want to use this mechanism to somehow signal for a retry, or something
> that).
> > The bottom line being, standardised interfaces in Commons Lang make me
> > uncomfortable. There are so many we can add, and I feel the strength
> > of Lang is in immediate usage of code in any Java project.
> I'd follow the JDK's lead in this case.  There are some interfaces that
> just so compelling and universal, like Comparable, that they belong at the
> fundamental level (like lang/exception or something like that).
> Cheers,
> Laird
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message