commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: [proxy] Commons-Lang Dependency...
Date Mon, 12 Sep 2005 10:25:51 GMT
How about we come up with a new interface called ExceptionHandler or
something that can be registered with the ExecutorMethodInterceptor?  We
could come up with a NullExceptionHandler which basically does nothing.  We
use a similar concept in HiveMind (ErrorHandler).  

I would like to be able to plug in error handling code for stuff like when
we find a final method in a superclass.  Right now, we merely ignore the
method and it doesn't get proxied.  But, I can see a case where you'd want
to throw an exception instead.  You'd almost have to invent an
ExceptionHandler interface which contains a method for each error scenario
or have different ExceptionHandler references for each scenario...

public class JavassistProxyFactory implements ProxyFactory
{
  private ExceptionHandler finalMethodInSuperclassHandler;
  
  // Setter/Getter
}

I don't know how it should look, but it would be nice to be able to
customize these scenarios on a case-by-case basis.  I would hate to have to
use a scenario id (or simply a message key) to decide which scenario we're
dealing with.

-----Original Message-----
From: Jörg Schaible [mailto:Joerg.Schaible@Elsag-Solutions.com] 
Sent: Monday, September 12, 2005 3:17 AM
To: Jakarta Commons Developers List
Subject: RE: [proxy] Commons-Lang Dependency...

Hi James,

James Carman wrote on Friday, September 09, 2005 1:33 PM:

> What good would a runtime exception do me at that point?  The
> method interceptor which contains that code is executing the
> method invocation in another thread using an Executor (JDK5).
>  So, the runtime exception wouldn't get back to the caller.
> At best it would probably just get printed to standard error
> or something.  That's why I chose to actually log the error in the
> first place. 

this is the typical use case for monitors (see
http://wiki.apache.org/avalon/AvalonNoLogging for background). Just invent a
monitor for the proxy package, that is called for different events. Then
it's up to a user, to register a monitor that will act on such an event.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message