ExceptionHelper.java

00001 
00026 package org.objectweb.jonas_ejb.lib;
00027 
00028 import org.objectweb.jorm.api.PException;
00029 import org.objectweb.medor.api.MedorException;
00030 
00034 public class ExceptionHelper {
00035 
00036         public static void printException(Exception e) {
00037         if (e instanceof PException
00038                         && ((PException) e).getNestedException()!=null) {
00039                         printException(((PException) e).getNestedException());
00040                 }
00041                 else if (e instanceof MedorException
00042                         && ((MedorException) e).getNestedException()!=null) {
00043                         System.out.println(e.getMessage());
00044                         printException(((MedorException) e).getNestedException());
00045                 }
00046                 else
00047                         e.printStackTrace();
00048     }
00049 
00050         public static Exception getException(Exception e) {
00051                 if (e instanceof PException
00052                         && ((PException) e).getNestedException()!=null) {
00053                         return getException(((PException) e).getNestedException());
00054                 }
00055                 else if (e instanceof MedorException
00056                         && ((MedorException) e).getNestedException()!=null) {
00057                         return getException(((MedorException) e).getNestedException());
00058                 }
00059                 else
00060                         return e;
00061         }
00062 }

Generated on Tue Feb 15 15:05:49 2005 for JOnAS by  doxygen 1.3.9.1