org.objectweb.carol.rmi.exception
Class RemoteExceptionHelper

java.lang.Object
  extended by org.objectweb.carol.rmi.exception.RemoteExceptionHelper

public class RemoteExceptionHelper
extends java.lang.Object

This class throws RemoteException by using provided exception, and set the detail attribute of the newly created exception. This avoid to forget initial exception.
initCause() cannot be used as it is a RemoteException.
Use detail attribute as suggested by Vadim Nasardinov

Author:
Florent Benoit (

Method Summary
static java.rmi.RemoteException create(java.lang.String message, java.lang.Exception originalException)
          Build a new exception with the given exception by wrapping it in a NoSuchObjectException
static java.rmi.RemoteException create(java.lang.String message, java.lang.Throwable originalThrowable)
          Build a new exception with the given Throwable by wrapping it in a NoSuchObjectException
static java.rmi.RemoteException create(java.lang.Throwable originalThrowable)
          Build a new exception with the given Throwable by wrapping it in a NoSuchObjectException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static java.rmi.RemoteException create(java.lang.String message,
                                              java.lang.Exception originalException)
Build a new exception with the given exception by wrapping it in a NoSuchObjectException

Parameters:
message - text error for the exception
originalException - original exception
Returns:
built exception

create

public static java.rmi.RemoteException create(java.lang.Throwable originalThrowable)
Build a new exception with the given Throwable by wrapping it in a NoSuchObjectException

Parameters:
originalThrowable - original throwable
Returns:
built exception

create

public static java.rmi.RemoteException create(java.lang.String message,
                                              java.lang.Throwable originalThrowable)
Build a new exception with the given Throwable by wrapping it in a NoSuchObjectException

Parameters:
message - text error for the exception
originalThrowable - original throwable
Returns:
built exception