From c742c2ef9d0d8414ff8a0888df9cf7c7d2fdb172 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 8 Feb 2022 14:27:33 +1100 Subject: [PATCH] Issue #7414 Deprecate QoSFilter setters (#7506) * Issue #7414 Deprecate QoSFilter setters Signed-off-by: Jan Bartel --- .../java/org/eclipse/jetty/servlets/QoSFilter.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java index d31f0aa146f3..c4f7b7c298d7 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java @@ -293,10 +293,12 @@ public long getWaitMs() * for the semaphore to become available before suspending a request. * * @param value wait time (in milliseconds) + * @deprecated use init-param waitMs instead */ + @Deprecated public void setWaitMs(long value) { - _waitMs = value; + LOG.warn("Setter ignored: use waitMs init-param for QoSFilter"); } /** @@ -316,10 +318,12 @@ public long getSuspendMs() * a request for while waiting for the semaphore to become available. * * @param value suspend time (in milliseconds) + * @deprecated use init-param suspendMs instead */ + @Deprecated public void setSuspendMs(long value) { - _suspendMs = value; + LOG.warn("Setter ignored: use suspendMs init-param for QoSFilter"); } /** @@ -339,11 +343,12 @@ public int getMaxRequests() * at the same time. * * @param value the number of requests + * @deprecated use init-param maxRequests instead */ + @Deprecated public void setMaxRequests(int value) { - _passes = new Semaphore((value - getMaxRequests() + _passes.availablePermits()), true); - _maxRequests = value; + LOG.warn("Setter ignored: use maxRequests init-param for QoSFilter instead"); } private class QoSAsyncListener implements AsyncListener