1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.remoting;
  17. import org.springframework.core.NestedRuntimeException;
  18. /**
  19. * Generic remote access exception. A service proxy for any remoting
  20. * protocol and toolkit should throw this exception or subclasses of it,
  21. * to be able to transparently expose a plain Java business interface.
  22. *
  23. * <p>When using conforming proxies, switching the actual remoting toolkit
  24. * e.g. from Hessian to Burlap does not affect client code. The latter
  25. * works with a plain Java business interface that the service exposes.
  26. * A client object simply receives an implementation for the interface that
  27. * it needs via a bean reference, like it does for local beans too.
  28. *
  29. * <p>A client can catch RemoteAccessException if it wants too, but as
  30. * remote access errors are typically unrecoverable, it will probably let
  31. * such exceptions propagate to a higher level that handles them generically.
  32. * In this case, the client code doesn't show any signs of being involved in
  33. * remote access, as there aren't any remoting-specific dependencies.
  34. *
  35. * <p>Even when switching from a remote service proxy to a local implementation
  36. * of the same interface, this amounts to just a matter of configuration.
  37. * Obviously, the client code should be somewhat aware that it _could work_
  38. * on a remote service, for example in terms of repeated method calls that
  39. * cause unnecessary roundtrips etc. But it doesn't have to be aware whether
  40. * it <i>actually works</i> on a remote service or a local implementation, or
  41. * with which remoting toolkit under the hood.
  42. *
  43. * @author Juergen Hoeller
  44. * @since 14.05.2003
  45. */
  46. public class RemoteAccessException extends NestedRuntimeException {
  47. public RemoteAccessException(String msg, Throwable ex) {
  48. super(msg, ex);
  49. }
  50. }