KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > user > client > rpc > IncompatibleRemoteServiceException


1 /*
2  * Copyright 2007 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * 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, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

16 package com.google.gwt.user.client.rpc;
17
18 /**
19  * Exception that will be passed to the
20  * {@link AsyncCallback#onFailure(Throwable)} method when an incompatibility is
21  * detected between a {@link RemoteService} client and its corresponding
22  * {@link RemoteService} server.
23  *
24  * <p>
25  * The correct response to receiving an instance of this exception in the
26  * {@link AsyncCallback#onFailure(Throwable)} method is to get the application
27  * into a state where a browser refresh can be done.
28  * </p>
29  *
30  * <p>
31  * This exception can be caused by the following problems:
32  * <ul>
33  * <li>The requested {@link RemoteService} cannot be located via
34  * {@link Class#forName(String)} on the server.</li>
35  * <li>The requested {@link RemoteService} interface is not implemented by the
36  * {@link com.google.gwt.user.server.rpc.RemoteServiceServlet RemoteServiceServlet}
37  * instance which is configured to process the request.</li>
38  * <li>The requested service method is not defined or inherited by the
39  * requested {@link RemoteService} interface.</li>
40  * <li>One of the types used in the {@link RemoteService} method invocation has
41  * had fields added or removed.</li>
42  * <li>The client code receives a type from the server which it cannot
43  * deserialize.</li>
44  * </ul>
45  * </p>
46  *
47  * <p>
48  * Note that on the client, the {@link #getCause()} always return
49  * <code>null</code>.
50  * </p>
51  */

52 public final class IncompatibleRemoteServiceException extends RuntimeException JavaDoc
53     implements IsSerializable {
54   /**
55    * Constructor used by RPC serialization. Note that the client side code will
56    * always get a generic error message.
57    */

58   public IncompatibleRemoteServiceException() {
59     super(
60         "This application is out of date, please click the refresh button on your browser");
61   }
62
63   /**
64    * Constructs an instance with the specified message.
65    */

66   public IncompatibleRemoteServiceException(String JavaDoc msg) {
67     super(msg);
68   }
69
70   /**
71    * Constructs an instance with the specified message and cause.
72    */

73   public IncompatibleRemoteServiceException(String JavaDoc msg, Throwable JavaDoc cause) {
74     super(msg, cause);
75   }
76 }
77
Popular Tags