You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/03/11 22:42:36 UTC

[httpcomponents-core] 02/06: Added default `ConnectionAcceptor#listen` method that takes an optional attachment as a parameter

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 1776fbca4000d46588bf24410fac00c171738513
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun Dec 6 11:04:29 2020 +0100

    Added default `ConnectionAcceptor#listen` method that takes an optional attachment as a parameter
---
 .../apache/hc/core5/reactor/ConnectionAcceptor.java    | 18 ++++++++++++++++++
 pom.xml                                                |  7 +++++++
 2 files changed, 25 insertions(+)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ConnectionAcceptor.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ConnectionAcceptor.java
index e98eb61..07d601b 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ConnectionAcceptor.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ConnectionAcceptor.java
@@ -48,6 +48,24 @@ public interface ConnectionAcceptor {
      * dispatcher.
      *
      * @param address the socket address to listen on.
+     * @param attachment the attachment object.
+     * @param callback the result callback.
+     * @return listener endpoint.
+     *
+     * @since 5.2
+     */
+    default Future<ListenerEndpoint> listen(
+            SocketAddress address, Object attachment, FutureCallback<ListenerEndpoint> callback) {
+        return listen(address, callback);
+    }
+
+    /**
+     * Opens a new listener endpoint with the given socket address. Once
+     * the endpoint is fully initialized it starts accepting incoming
+     * connections and propagates I/O activity notifications to the I/O event
+     * dispatcher.
+     *
+     * @param address the socket address to listen on.
      * @param callback the result callback.
      * @return listener endpoint.
      */
diff --git a/pom.xml b/pom.xml
index 3c77ced..3c2c615 100644
--- a/pom.xml
+++ b/pom.xml
@@ -176,6 +176,13 @@
           <parameter>
             <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
             <breakBuildOnSourceIncompatibleModifications>true</breakBuildOnSourceIncompatibleModifications>
+            <overrideCompatibilityChangeParameters>
+              <overrideCompatibilityChangeParameter>
+                <compatibilityChange>METHOD_NEW_DEFAULT</compatibilityChange>
+                <binaryCompatible>true</binaryCompatible>
+                <sourceCompatible>true</sourceCompatible>
+              </overrideCompatibilityChangeParameter>
+            </overrideCompatibilityChangeParameters>
             <excludes>
               <exclude>@org.apache.hc.core5.annotation.Internal</exclude>
             </excludes>