commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Dantas Rocha" <>
Subject RES: Possible incubation?
Date Wed, 08 Apr 2009 12:12:53 GMT
Hi Jorg,

Actually you can declare handlers in methods and/or class and use a special invocation in
your catch block -- HandlerUtil.handle(e) -- to tell it you want to use the declared exception.
This is the more flexible approach, because you can handle only what you want.

The other option is to let Jeha put the method invocation automatically, by a Ant task through
Javassist. In this case it's not necessary to codify anything (only annotation) and all catch
blocks will contain a call to HandlerUtil.handle(e).

In relation to rethrow, Jeha uses this interface to handle any exception specified by the

public interface Handler {
   public Throwable handle(Throwable throwable, Object... methodParams);

Since handle() method returns Throwable, you can rethrow an exception any time you want.



-----Mensagem original-----
De: news [] Em nome de Jörg Schaible
Enviada em: quarta-feira, 8 de abril de 2009 03:43
Assunto: Re: Possible incubation?

Hi Andre,

Andre Dantas Rocha wrote at Dienstag, 7. April 2009 14:38:

> Hi all,
> This message was originally sent to incubator list, but they suggest to
> post it here because *maybe* the idea can fit in Commons project.
> I'm developing a framework called Jeha. The main idea is to provide easy
> exception description and handling using annotations in methods and
> classes
> and some commons handlers. I believe that the  idea is simple, but
> powerful.
> The initial code and start guide of framework are here:
> 931&release_id=650572>
> 31&release_id=650572
> I'd like to hear from community if this idea is valuable for a possible
> incubation.
> Please let me know your opinion.

It might be only me, but I see this approach a bit critical. On one hand
you're right, writing exception code is quite tedious sometimes, but with
your solution you wipe out any useful method signature regarding exception
declaration. What happens if I don't wanna handle certain exception types
or RuntimeException instances? I cannot simply rethrow from the handler.

- Jörg

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

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

View raw message