01: /*
02: * Copyright 2002-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.springframework.remoting;
18:
19: import org.springframework.core.NestedRuntimeException;
20:
21: /**
22: * Generic remote access exception. A service proxy for any remoting
23: * protocol and toolkit should throw this exception or subclasses of it,
24: * to be able to transparently expose a plain Java business interface.
25: *
26: * <p>When using conforming proxies, switching the actual remoting toolkit
27: * e.g. from Hessian to Burlap does not affect client code. The latter
28: * works with a plain Java business interface that the service exposes.
29: * A client object simply receives an implementation for the interface that
30: * it needs via a bean reference, like it does for local beans too.
31: *
32: * <p>A client can catch RemoteAccessException if it wants to, but as
33: * remote access errors are typically unrecoverable, it will probably let
34: * such exceptions propagate to a higher level that handles them generically.
35: * In this case, the client code doesn't show any signs of being involved in
36: * remote access, as there aren't any remoting-specific dependencies.
37: *
38: * <p>Even when switching from a remote service proxy to a local implementation
39: * of the same interface, this amounts to just a matter of configuration.
40: * Obviously, the client code should be somewhat aware that it _could work_
41: * on a remote service, for example in terms of repeated method calls that
42: * cause unnecessary roundtrips etc. But it doesn't have to be aware whether
43: * it <i>actually works</i> on a remote service or a local implementation, or
44: * with which remoting toolkit under the hood.
45: *
46: * @author Juergen Hoeller
47: * @since 14.05.2003
48: */
49: public class RemoteAccessException extends NestedRuntimeException {
50:
51: /**
52: * Constructor for RemoteAccessException.
53: * @param msg the detail message
54: */
55: public RemoteAccessException(String msg) {
56: super (msg);
57: }
58:
59: /**
60: * Constructor for RemoteAccessException.
61: * @param msg the detail message
62: * @param cause the root cause (usually from using an underlying
63: * remoting API such as RMI)
64: */
65: public RemoteAccessException(String msg, Throwable cause) {
66: super(msg, cause);
67: }
68:
69: }
|