JBoss Remoting 3.1.0.Beta1

org.jboss.remoting3
Class RemoteExecutionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by org.jboss.remoting3.RemotingException
                  extended by org.jboss.remoting3.RemoteExecutionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RemoteReplyException

public class RemoteExecutionException
extends RemotingException

Exception thrown when execution of a remote operation fails for some reason.

See Also:
Serialized Form

Constructor Summary
RemoteExecutionException()
          Constructs a RemoteExecutionException with no detail message.
RemoteExecutionException(String msg)
          Constructs a RemoteExecutionException with the specified detail message.
RemoteExecutionException(String msg, Throwable cause)
          Constructs a RemoteExecutionException with the specified detail message and cause.
RemoteExecutionException(Throwable cause)
          Constructs a RemoteExecutionException with the specified cause.
 
Method Summary
<T extends Throwable>
void
rethrow(Class<T> type)
          Convenience method to rethrow the cause of a RemoteExecutionException as a specific type, in order to simplify application exception handling.
 IllegalStateException unexpected()
          Convenience method to get an unexpected exception type wrapped within a runtime exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteExecutionException

public RemoteExecutionException()
Constructs a RemoteExecutionException with no detail message. The cause is not initialized, and may subsequently be initialized by a call to initCause.


RemoteExecutionException

public RemoteExecutionException(String msg)
Constructs a RemoteExecutionException with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to initCause.

Parameters:
msg - the detail message

RemoteExecutionException

public RemoteExecutionException(Throwable cause)
Constructs a RemoteExecutionException with the specified cause. The detail message is set to:
  (cause == null ? null : cause.toString())
(which typically contains the class and detail message of cause).

Parameters:
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method)

RemoteExecutionException

public RemoteExecutionException(String msg,
                                Throwable cause)
Constructs a RemoteExecutionException with the specified detail message and cause.

Parameters:
msg - the detail message
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method)
Method Detail

rethrow

public <T extends Throwable> void rethrow(Class<T> type)
             throws T extends Throwable
Convenience method to rethrow the cause of a RemoteExecutionException as a specific type, in order to simplify application exception handling.

A typical usage might look like this:

   try {
     client.invoke(request);
   } catch (RemoteExecutionException ree) {
     ree.rethrow(IOException.class);
     ree.rethrow(RuntimeException.class);
     throw ree.unexpected();
   }
 

Note that if the nested exception is an InterruptedException, the type that will actually be thrown will be RemoteInterruptedException.

Type Parameters:
T - the exception type
Parameters:
type - the class of the exception
Throws:
T - the exception, if it matches the given type
T extends Throwable

unexpected

public IllegalStateException unexpected()
Convenience method to get an unexpected exception type wrapped within a runtime exception.


JBoss Remoting 3.1.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.