diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/api/Stream.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/api/Stream.java index 3d604a04572..762ebcc8944 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/api/Stream.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/api/Stream.java @@ -172,6 +172,19 @@ public interface Stream */ public void onReset(Stream stream, ResetFrame frame); + /** + *

Callback method invoked when the stream exceeds its idle timeout.

+ * + * @param stream the stream + * @param x the timeout failure + * @see #getIdleTimeout() + * @deprecated use {@link #onIdleTimeout(Stream, Throwable)} instead + */ + @Deprecated + public default void onTimeout(Stream stream, Throwable x) + { + } + /** *

Callback method invoked when the stream exceeds its idle timeout.

* @@ -180,7 +193,11 @@ public interface Stream * @see #getIdleTimeout() * @return true to reset the stream, false to ignore the idle timeout */ - public boolean onIdleTimeout(Stream stream, Throwable x); + public default boolean onIdleTimeout(Stream stream, Throwable x) + { + onTimeout(stream, x); + return true; + } /** *

Empty implementation of {@link Listener}

@@ -209,6 +226,11 @@ public interface Stream { } + @Override + public void onTimeout(Stream stream, Throwable x) + { + } + @Override public boolean onIdleTimeout(Stream stream, Throwable x) {