org.objectweb.carol.rmi.exception
Class NamingExceptionHelper

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

public class NamingExceptionHelper
extends java.lang.Object

This class throw NamingException by using provided exception, and set the initCause of the newly created exception. This avoid to forget initial exception

Author:
Florent Benoit

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

Method Detail

create

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

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

create

public static javax.naming.NamingException create(java.lang.String message,
                                                  java.lang.Throwable t)
Build a new exception with the given error by wrapping it in a NamingException

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