站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

RemoteAccessException (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.remoting
Class RemoteAccessException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.springframework.core.NestedRuntimeException
                  extended by org.springframework.remoting.RemoteAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RemoteConnectFailureException, RemoteLookupFailureException, RemoteProxyFailureException

public class RemoteAccessException
extends NestedRuntimeException

Generic remote access exception. A service proxy for any remoting protocol and toolkit should throw this exception or subclasses of it, to be able to transparently expose a plain Java business interface.

When using conforming proxies, switching the actual remoting toolkit e.g. from Hessian to Burlap does not affect client code. The latter works with a plain Java business interface that the service exposes. A client object simply receives an implementation for the interface that it needs via a bean reference, like it does for local beans too.

A client can catch RemoteAccessException if it wants to, but as remote access errors are typically unrecoverable, it will probably let such exceptions propagate to a higher level that handles them generically. In this case, the client code doesn't show any signs of being involved in remote access, as there aren't any remoting-specific dependencies.

Even when switching from a remote service proxy to a local implementation of the same interface, this amounts to just a matter of configuration. Obviously, the client code should be somewhat aware that it _could work_ on a remote service, for example in terms of repeated method calls that cause unnecessary roundtrips etc. But it doesn't have to be aware whether it actually works on a remote service or a local implementation, or with which remoting toolkit under the hood.

Since:
14.05.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
RemoteAccessException(String msg)
          Constructor for RemoteAccessException.
RemoteAccessException(String msg, Throwable cause)
          Constructor for RemoteAccessException.
 
Method Summary
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getCause, getMessage, getMostSpecificCause, getRootCause, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteAccessException

public RemoteAccessException(String msg)
Constructor for RemoteAccessException.

Parameters:
msg - the detail message

RemoteAccessException

public RemoteAccessException(String msg,
                             Throwable cause)
Constructor for RemoteAccessException.

Parameters:
msg - the detail message
cause - the root cause (usually from using an underlying remoting API such as RMI)

The Spring Framework

Copyright © 2002-2007 The Spring Framework.