com.tzavellas.dyndelegate
Class EJBExceptionConverter

java.lang.Object
  extended by com.tzavellas.dyndelegate.EJBExceptionConverter
All Implemented Interfaces:
ThrowableConverter

public class EJBExceptionConverter
extends Object
implements ThrowableConverter

A ThrowableConverter implementation suitable for converting Exceptions in Business Delegate implementations.

This converter, tries to hide EJB specific exceptions like RemoteException and EJBException.

Author:
Spiros Tzavellas
See Also:
ThrowableConverter

Constructor Summary
EJBExceptionConverter()
           
 
Method Summary
 Throwable convert(Throwable ex)
          If the specified Throwable is a RemoteException that wraps an unchecked exception return the wrapped unchecked exception, else return a RuntimeException wrapping the RemoteException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJBExceptionConverter

public EJBExceptionConverter()
Method Detail

convert

public Throwable convert(Throwable ex)
If the specified Throwable is a RemoteException that wraps an unchecked exception return the wrapped unchecked exception, else return a RuntimeException wrapping the RemoteException. If the specified Throwable is an EJBException that wraps an unchecked exception return the wrapped unchecked exception, else return the EJBException. If none of the above conditions apply, return the specified Throwable without any modification.

Specified by:
convert in interface ThrowableConverter
Parameters:
ex - the Throwable to convert
Returns:
a Throwable


Copyright © 2005-2009 spiros.blog(). All Rights Reserved.