Class ExceptionChainConversionInterceptor

  extended by ch.elca.el4j.core.aop.ExceptionChainConversionInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class ExceptionChainConversionInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor

Interceptor that converts the cause of an Exception thrown by the intercepted method into a Throwable instance. Nested causes are processed as well.
The purpose of this interceptor is to assure that a client using the intercepted service can deserialize (unmarshall) a possible Exception thrown by the service in any case. Due to exception chaining, the exception could contain instances of (arbitrary) subclasses of Throwable as cause that are not known by the client and can therefore not be deserialized. This class was contributed to EL4J by Reto Fankhauser.

Reto Fankhauser (RFA)
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Constructor Summary
          Default constructor.
Method Summary
protected  Throwable convertCause(Throwable original)
          Converts the Throwable passed in (can be any subclass of Throwable) into a Throwable (not a subclass of it).
 Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ExceptionChainConversionInterceptor()
Default constructor.

Method Detail


public Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
              throws Throwable

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor


protected Throwable convertCause(Throwable original)
Converts the Throwable passed in (can be any subclass of Throwable) into a Throwable (not a subclass of it). The converted exception is known in any JVM. This means that the converted Throwable can be deserialized in any JVM. This method also recursively converts nested causes of exception causes.

original - The Throwable to convert.
The converted Throwable. Instance of Throwable (no subclass).

Copyright © 2005-2011 ELCA. All Rights Reserved.