Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow is designed to build PRs for AHC. Note that it does not actually publish AHC, just builds and test it.
# Docs: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Build and Test PR
name: Build PR

on:
push:
Expand All @@ -17,9 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Grant Permission
run: sudo chmod +x ./mvnw
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '11'
- name: Run Tests
run: mvn -B -ntp clean test
run: ./mvnw -B -ntp clean test
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://maven-central.storage-download.googleapis.com/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://maven-central.storage-download.googleapis.com/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

108 changes: 0 additions & 108 deletions bom/pom.xml

This file was deleted.

77 changes: 12 additions & 65 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,32 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<version>2.12.4-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>async-http-client</artifactId>
<name>Asynchronous Http Client</name>
<name>AHC/Client</name>
<description>The Async Http Client (AHC) classes.</description>

<properties>
<javaModuleName>org.asynchttpclient.client</javaModuleName>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-netty-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-socks</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.netty</groupId>
<artifactId>netty-reactive-streams</artifactId>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams-examples</artifactId>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/javax.portlet/portlet-api -->
<dependency>
<groupId>org.apache.kerby</groupId>
<artifactId>kerb-simplekdc</artifactId>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.InputStream;
import java.util.concurrent.Future;

/**
* An {@link AsyncHandler} augmented with an {@link #onCompleted(Response)}
* convenience method which gets called when the {@link Response} processing is
* finished. This class also implements the {@link ProgressAsyncHandler}
* callback, all doing nothing except returning
* {@link org.asynchttpclient.AsyncHandler.State#CONTINUE}
* {@link AsyncHandler.State#CONTINUE}
*
* @param <T> Type of the value that will be returned by the associated
* {@link java.util.concurrent.Future}
* {@link Future}
*/
public abstract class AsyncCompletionHandler<T> implements ProgressAsyncHandler<T> {

Expand Down Expand Up @@ -76,15 +80,15 @@ public void onThrowable(Throwable t) {
*
* @param response The {@link Response}
* @return T Value that will be returned by the associated
* {@link java.util.concurrent.Future}
* {@link Future}
* @throws Exception if something wrong happens
*/
abstract public T onCompleted(Response response) throws Exception;
public abstract T onCompleted(Response response) throws Exception;

/**
* Invoked when the HTTP headers have been fully written on the I/O socket.
*
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
* @return a {@link AsyncHandler.State} telling to CONTINUE
* or ABORT the current processing.
*/
@Override
Expand All @@ -93,10 +97,10 @@ public State onHeadersWritten() {
}

/**
* Invoked when the content (a {@link java.io.File}, {@link String} or
* {@link java.io.InputStream} has been fully written on the I/O socket.
* Invoked when the content (a {@link File}, {@link String} or
* {@link InputStream} has been fully written on the I/O socket.
*
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
* @return a {@link AsyncHandler.State} telling to CONTINUE
* or ABORT the current processing.
*/
@Override
Expand All @@ -111,7 +115,7 @@ public State onContentWritten() {
* @param amount The amount of bytes to transfer
* @param current The amount of bytes transferred
* @param total The total number of bytes transferred
* @return a {@link org.asynchttpclient.AsyncHandler.State} telling to CONTINUE
* @return a {@link AsyncHandler.State} telling to CONTINUE
* or ABORT the current processing.
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
* Simple {@link AsyncHandler} of type {@link Response}
*/
public class AsyncCompletionHandlerBase extends AsyncCompletionHandler<Response> {
/**
* {@inheritDoc}
*/
@Override
public Response onCompleted(Response response) throws Exception {
return response;
Expand Down
5 changes: 3 additions & 2 deletions client/src/main/java/org/asynchttpclient/AsyncHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.net.ssl.SSLSession;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.concurrent.Future;


/**
Expand Down Expand Up @@ -55,7 +56,7 @@
* There's a chance you might end up in a dead lock.
* If you really need to perform a blocking operation, execute it in a different dedicated thread pool.
*
* @param <T> Type of object returned by the {@link java.util.concurrent.Future#get}
* @param <T> Type of object returned by the {@link Future#get}
*/
public interface AsyncHandler<T> {

Expand Down Expand Up @@ -111,7 +112,7 @@ default State onTrailingHeadersReceived(HttpHeaders headers) throws Exception {
* <br>
* Gets always invoked as last callback method.
*
* @return T Value that will be returned by the associated {@link java.util.concurrent.Future}
* @return T Value that will be returned by the associated {@link Future}
* @throws Exception if something wrong happens
*/
T onCompleted() throws Exception;
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/org/asynchttpclient/AsyncHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public interface AsyncHttpClient extends Closeable {
*
* @param request {@link Request}
* @param handler an instance of {@link AsyncHandler}
* @param <T> Type of the value that will be returned by the associated {@link java.util.concurrent.Future}
* @param <T> Type of the value that will be returned by the associated {@link Future}
* @return a {@link Future} of type T
*/
<T> ListenableFuture<T> executeRequest(Request request, AsyncHandler<T> handler);
Expand All @@ -258,7 +258,7 @@ public interface AsyncHttpClient extends Closeable {
*
* @param requestBuilder {@link RequestBuilder}
* @param handler an instance of {@link AsyncHandler}
* @param <T> Type of the value that will be returned by the associated {@link java.util.concurrent.Future}
* @param <T> Type of the value that will be returned by the associated {@link Future}
* @return a {@link Future} of type T
*/
<T> ListenableFuture<T> executeRequest(RequestBuilder requestBuilder, AsyncHandler<T> handler);
Expand Down
Loading