com.croftsoft.core.lang
Class ExternalAccessException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.croftsoft.core.lang.ExternalAccessException
All Implemented Interfaces:
Serializable

public final class ExternalAccessException
extends Exception

Indicates an Exception while accessing an external resource.

Useful for propagating an SQLException or RemoteException through a Data Access Object (DAO) interface. Define the data accessor interface methods so that they throw ExternalAccessException instead of SQLException, RemoteException, IOException, or any other Exception indicating external access failure. Since the calling application no longer needs to be hard-coded to handle an Exception subclass specific to the data access mechanism, the mechanism can be easily replaced, at run-time if desired, simply by instantiating a different concrete implementation of the data accessor interface.

The original Exception is passed into the ExternalAccessException as a constructor argument. The Exception stack trace is stored as a String within the ExternalAccessException in order to facilitate serialization and persistence without the need to transport class files.

Since:
2001-02-28
Version:
2001-06-21
See Also:
Sun Java Center J2EE Patterns: Data Access Object, "A Note on Distributed Computing", Serialized Form
Author:
David W. Croft

Constructor Summary
ExternalAccessException()
           
ExternalAccessException(Exception rootException)
           
ExternalAccessException(String message)
           
ExternalAccessException(String message, Exception rootException)
           
 
Method Summary
 String getRootExceptionStackTrace()
           
 
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

ExternalAccessException

public ExternalAccessException(String message,
                               Exception rootException)

ExternalAccessException

public ExternalAccessException(Exception rootException)

ExternalAccessException

public ExternalAccessException(String message)

ExternalAccessException

public ExternalAccessException()
Method Detail

getRootExceptionStackTrace

public String getRootExceptionStackTrace()

CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)