Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'.

Restored backwards compatibility on Stream.Listener interface.
This commit is contained in:
Simone Bordet 2016-08-14 12:22:34 +02:00
commit 0140d09997
1 changed files with 23 additions and 1 deletions

View File

@ -172,6 +172,19 @@ public interface Stream
*/
public void onReset(Stream stream, ResetFrame frame);
/**
* <p>Callback method invoked when the stream exceeds its idle timeout.</p>
*
* @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)
{
}
/**
* <p>Callback method invoked when the stream exceeds its idle timeout.</p>
*
@ -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;
}
/**
* <p>Empty implementation of {@link Listener}</p>
@ -209,6 +226,11 @@ public interface Stream
{
}
@Override
public void onTimeout(Stream stream, Throwable x)
{
}
@Override
public boolean onIdleTimeout(Stream stream, Throwable x)
{