|
| 1 | +/* |
| 2 | + * Copyright (c) 2010-2012 Sonatype, Inc. All rights reserved. |
| 3 | + * |
| 4 | + * This program is licensed to you under the Apache License Version 2.0, |
| 5 | + * and you may not use this file except in compliance with the Apache License Version 2.0. |
| 6 | + * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0. |
| 7 | + * |
| 8 | + * Unless required by applicable law or agreed to in writing, |
| 9 | + * software distributed under the Apache License Version 2.0 is distributed on an |
| 10 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | + * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. |
| 12 | + */ |
| 13 | +package com.ning.http.client; |
| 14 | + |
| 15 | +/** |
| 16 | + * This interface hosts new low level callback methods on {@link AsyncHandler}. |
| 17 | + * For now, those methods are in a dedicated interface in order not to break the existing API, |
| 18 | + * but could be merged into one of the existing ones in AHC 2. |
| 19 | + * |
| 20 | + * More additional hooks might come, such as: |
| 21 | + * <ul> |
| 22 | + * <li>onRetry()</li> |
| 23 | + * <li>onConnected()</li> |
| 24 | + * <li>onConnectionClosed()</li> |
| 25 | + * <li>onBytesSent(long numberOfBytes)</li> |
| 26 | + * <li>onBytesReceived(long numberOfBytes)</li> |
| 27 | + * </ul> |
| 28 | + */ |
| 29 | +public interface AsyncHandlerExtensions { |
| 30 | + |
| 31 | + /** |
| 32 | + * Notify the callback when a request is being written on the wire. |
| 33 | + * If the original request causes multiple requests to be sent, for example, because of authorization or retry, |
| 34 | + * it will be notified multiple times. |
| 35 | + * Currently only supported by the Netty provider. |
| 36 | + */ |
| 37 | + void onRequestSent(); |
| 38 | +} |
0 commit comments