1 25 package org.objectweb.carol.rmi.exception; 26 27 import java.rmi.NoSuchObjectException ; 28 29 37 public class NoSuchObjectExceptionHelper { 38 39 42 private NoSuchObjectExceptionHelper() { 43 } 44 45 51 public static NoSuchObjectException create(String message, Exception originalException) { 52 NoSuchObjectException ne = new NoSuchObjectException (message); 53 ne.detail = originalException; 54 return ne; 55 } 56 57 62 public static NoSuchObjectException create(Throwable originalThrowable) { 63 if (originalThrowable instanceof NoSuchObjectException ) { 64 return (NoSuchObjectException ) originalThrowable; 65 } else { 66 NoSuchObjectException ne = new NoSuchObjectException (originalThrowable.getMessage()); 67 ne.detail = originalThrowable; 68 return ne; 69 } 70 } 71 72 78 public static NoSuchObjectException create(String message, Throwable originalThrowable) { 79 if (originalThrowable instanceof NoSuchObjectException ) { 80 return (NoSuchObjectException ) originalThrowable; 81 } else { 82 NoSuchObjectException ne = new NoSuchObjectException (message); 83 ne.detail = originalThrowable; 84 return ne; 85 } 86 } 87 88 } 89 | Popular Tags |