]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/lib/java/src/org/apache/thrift/async/AsyncMethodCallback.java
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / jaegertracing / thrift / lib / java / src / org / apache / thrift / async / AsyncMethodCallback.java
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.thrift.async;
20
21 /**
22 * A handler interface asynchronous clients can implement to receive future
23 * notice of the results of an asynchronous method call.
24 *
25 * @param <T> The return type of the asynchronously invoked method.
26 */
27 public interface AsyncMethodCallback<T> {
28 /**
29 * This method will be called when the remote side has completed invoking
30 * your method call and the result is fully read. For {@code oneway} method
31 * calls, this method will be called as soon as we have completed writing out
32 * the request.
33 *
34 * @param response The return value of the asynchronously invoked method;
35 * {@code null} for void methods which includes
36 * {@code oneway} methods.
37 */
38 void onComplete(T response);
39
40 /**
41 * This method will be called when there is either an unexpected client-side
42 * exception like an IOException or else when the remote method raises an
43 * exception, either declared in the IDL or due to an unexpected server-side
44 * error.
45 *
46 * @param exception The exception encountered processing the the asynchronous
47 * method call, may be a local exception or an unmarshalled
48 * remote exception.
49 */
50 void onError(Exception exception);
51 }