1 18 package org.apache.geronimo.interop.rmi.iiop; 19 20 import org.apache.geronimo.interop.SystemException; 21 import org.apache.geronimo.interop.util.ExceptionUtil; 22 23 24 public abstract class RemoteExceptionFactory { 25 public static java.rmi.RemoteException getException(Exception ex) { 26 if (ex instanceof SystemException) { 27 Throwable cause = ((SystemException) ex).getCause(); 28 if (cause instanceof org.omg.CORBA.SystemException ) { 29 org.omg.CORBA.SystemException corbaException = (org.omg.CORBA.SystemException ) cause; 30 if (ex.getMessage() == null) { 31 return new java.rmi.ServerException (corbaException.getClass().getName(), corbaException); 32 } else { 33 return new java.rmi.ServerException (ex.getMessage(), corbaException); 34 } 35 } 36 } 37 return new java.rmi.RemoteException (ExceptionUtil.getStackTrace(ex)); 38 } 39 } 40 | Popular Tags |