CONTENTS | PREV | NEXT Java Remote Method Invocation


4.2 The RemoteException Class

All remote exceptions are subclasses of java.rmi.RemoteException. This allows interfaces to handle all types of remote exceptions and to distinguish local exceptions, and exceptions specific to the method, from exceptions thrown by the underlying distributed object mechanisms.

package java.rmi;
public class RemoteException extends java.io.IOException
{
	// The actual exception or error that occurred.    
	public Throwable detail;

	// Create a remote exception.
	public RemoteException();

	// Create a remote exception with the specified string.
	public RemoteException(String s);

	// Create remote exception with specified string and exception.
	public RemoteException(String s, Throwable ex);

	// Produce message, including message from any nested exception.
	public String getMessage();
}


A RemoteException can be constructed with a nested exception (a Throwable). Typically, the nested exception, ex, specified as a parameter in the third form of the constructor, is the underlying I/O exception that occurred during an RMI call.



CONTENTS | PREV | NEXT
Copyright © 1997-1998 Sun Microsystems, Inc. All Rights Reserved.