From c8d7bf01e1f70b576c835a6b48f6d34d4ac0e079 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Mon, 22 Mar 2021 10:17:59 +0100 Subject: [PATCH] better align client and server impls Signed-off-by: Ludovic Orban --- .../http3/client/ClientDatagramEndPoint.java | 28 +++++++++---------- .../http3/server/ServerDatagramEndPoint.java | 8 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/jetty-http3/http3-client/src/main/java/org/eclipse/jetty/http3/client/ClientDatagramEndPoint.java b/jetty-http3/http3-client/src/main/java/org/eclipse/jetty/http3/client/ClientDatagramEndPoint.java index fd2bfdf15de..3a64b16d375 100644 --- a/jetty-http3/http3-client/src/main/java/org/eclipse/jetty/http3/client/ClientDatagramEndPoint.java +++ b/jetty-http3/http3-client/src/main/java/org/eclipse/jetty/http3/client/ClientDatagramEndPoint.java @@ -61,7 +61,7 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS @Override public String toString() { - return String.format("%s:%s:%s", this, _operation, getInvocationType()); + return String.format("%s:%s:%s", ClientDatagramEndPoint.this, _operation, getInvocationType()); } } @@ -77,11 +77,11 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS { try { - this.close(); + ClientDatagramEndPoint.this.close(); } catch (Throwable x) { - LOG.warn("Unable to close {}", this, x); + LOG.warn("Unable to close {}", ClientDatagramEndPoint.this, x); } } } @@ -91,7 +91,7 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS private final Runnable _runFillable = new RunnableCloseable("runFillable") { @Override - public Invocable.InvocationType getInvocationType() + public InvocationType getInvocationType() { return getFillInterest().getCallbackInvocationType(); } @@ -106,7 +106,7 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS private final Runnable _runCompleteWrite = new RunnableCloseable("runCompleteWrite") { @Override - public Invocable.InvocationType getInvocationType() + public InvocationType getInvocationType() { return getWriteFlusher().getCallbackInvocationType(); } @@ -120,27 +120,27 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS @Override public String toString() { - return String.format("%s:%s:%s->%s", this, _operation, getInvocationType(), getWriteFlusher()); + return String.format("%s:%s:%s->%s", ClientDatagramEndPoint.this, _operation, getInvocationType(), getWriteFlusher()); } }; private final Runnable _runCompleteWriteFillable = new RunnableCloseable("runCompleteWriteFillable") { @Override - public Invocable.InvocationType getInvocationType() + public InvocationType getInvocationType() { - Invocable.InvocationType fillT = getFillInterest().getCallbackInvocationType(); - Invocable.InvocationType flushT = getWriteFlusher().getCallbackInvocationType(); + InvocationType fillT = getFillInterest().getCallbackInvocationType(); + InvocationType flushT = getWriteFlusher().getCallbackInvocationType(); if (fillT == flushT) return fillT; - if (fillT == Invocable.InvocationType.EITHER && flushT == Invocable.InvocationType.NON_BLOCKING) - return Invocable.InvocationType.EITHER; + if (fillT == InvocationType.EITHER && flushT == InvocationType.NON_BLOCKING) + return InvocationType.EITHER; - if (fillT == Invocable.InvocationType.NON_BLOCKING && flushT == Invocable.InvocationType.EITHER) - return Invocable.InvocationType.EITHER; + if (fillT == InvocationType.NON_BLOCKING && flushT == InvocationType.EITHER) + return InvocationType.EITHER; - return Invocable.InvocationType.BLOCKING; + return InvocationType.BLOCKING; } @Override diff --git a/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/ServerDatagramEndPoint.java b/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/ServerDatagramEndPoint.java index 6b46f05dcfa..d0900f1fc4d 100644 --- a/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/ServerDatagramEndPoint.java +++ b/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/ServerDatagramEndPoint.java @@ -65,7 +65,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS } } - private abstract class RunnableCloseable extends ServerDatagramEndPoint.RunnableTask implements Closeable + private abstract class RunnableCloseable extends RunnableTask implements Closeable { protected RunnableCloseable(String op) { @@ -88,7 +88,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS private final ManagedSelector.SelectorUpdate _updateKeyAction = this::updateKeyAction; - private final Runnable _runFillable = new ServerDatagramEndPoint.RunnableCloseable("runFillable") + private final Runnable _runFillable = new RunnableCloseable("runFillable") { @Override public InvocationType getInvocationType() @@ -103,7 +103,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS } }; - private final Runnable _runCompleteWrite = new ServerDatagramEndPoint.RunnableCloseable("runCompleteWrite") + private final Runnable _runCompleteWrite = new RunnableCloseable("runCompleteWrite") { @Override public InvocationType getInvocationType() @@ -124,7 +124,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS } }; - private final Runnable _runCompleteWriteFillable = new ServerDatagramEndPoint.RunnableCloseable("runCompleteWriteFillable") + private final Runnable _runCompleteWriteFillable = new RunnableCloseable("runCompleteWriteFillable") { @Override public InvocationType getInvocationType()