Package com.iizix.push.vapid
Class ClosableCallback
java.lang.Object
com.iizix.push.vapid.ClosableCallback
- All Implemented Interfaces:
- org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse>
public class ClosableCallback extends Object implements org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse>
Java 7's try-with-resource closes the client before the future is completed. This callback captures the client and closes it once the request is completed. See also http://stackoverflow.com/a/35962718/368220.
- Constructor SummaryConstructorsConstructorDescription- ClosableCallback- (org.apache.http.impl.nio.client.CloseableHttpAsyncClient closeableHttpAsyncClient) 
- Method Summary
- Constructor Details- ClosableCallbackpublic ClosableCallback- (org.apache.http.impl.nio.client.CloseableHttpAsyncClient closeableHttpAsyncClient) 
 
- Method Details- completedpublic void completed- (org.apache.http.HttpResponse httpResponse) - Specified by:
- completedin interface- org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse>
 
- failed- Specified by:
- failedin interface- org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse>
 
- cancelledpublic void cancelled()- Specified by:
- cancelledin interface- org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse>