1 25 package org.objectweb.carol.rmi.exception; 26 27 import java.rmi.RemoteException ; 28 29 30 38 public class RemoteExceptionHelper { 39 40 41 44 private RemoteExceptionHelper() { 45 } 46 47 53 public static RemoteException create(String message, Exception originalException) { 54 return new RemoteException (message, originalException); 55 } 56 57 62 public static RemoteException create(Throwable originalThrowable) { 63 if (originalThrowable instanceof RemoteException ) { 64 return (RemoteException ) originalThrowable; 65 } else { 66 return new RemoteException (originalThrowable.getMessage(), originalThrowable); 67 } 68 } 69 70 76 public static RemoteException create(String message, Throwable originalThrowable) { 77 if (originalThrowable instanceof RemoteException ) { 78 return (RemoteException ) originalThrowable; 79 } else { 80 return new RemoteException (message, originalThrowable); 81 } 82 } 83 } 84 | Popular Tags |