Package com.heroku.api

Source Code of com.heroku.api.AsyncHttpClientModule

package com.heroku.api;

import com.google.inject.Provides;
import com.heroku.api.connection.AsyncHttpClientConnection;
import com.heroku.api.connection.ListenableFutureConnection;
import com.heroku.api.exception.RequestFailedException;

import java.io.IOException;

public class AsyncHttpClientModule extends ConnectionTestModule {
    @Provides()
    ListenableFutureConnection getConnectionImpl() throws IOException {
        try {
            return new AsyncHttpClientConnection();
        } catch (RequestFailedException e) {
            System.out.println(e.getMessage());
            System.out.println(e.getStatusCode());
            System.out.println(e.getResponseBody());
            System.out.flush();
            e.printStackTrace();
            throw e;
        }
    }
}
TOP

Related Classes of com.heroku.api.AsyncHttpClientModule

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.