This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new fb2c92f Deprecate unused method. Improve Javadoc. fb2c92f is described below commit fb2c92fb333884da2235a0aa6bcb91b448a0cc36 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jul 21 17:24:53 2021 +0100 Deprecate unused method. Improve Javadoc. --- java/org/apache/tomcat/util/threads/TaskQueue.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java b/java/org/apache/tomcat/util/threads/TaskQueue.java index 268035e..3aad107 100644 --- a/java/org/apache/tomcat/util/threads/TaskQueue.java +++ b/java/org/apache/tomcat/util/threads/TaskQueue.java @@ -59,6 +59,15 @@ public class TaskQueue extends LinkedBlockingQueue<Runnable> { parent = tp; } + + /** + * Used to add a task to the queue if the task has been rejected by the Executor. + * + * @param o The task to add to the queue + * + * @return {@code true} if the task was added to the queue, + * otherwise {@code false} + */ public boolean force(Runnable o) { if (parent == null || parent.isShutdown()) { throw new RejectedExecutionException(sm.getString("taskQueue.notRunning")); @@ -66,6 +75,23 @@ public class TaskQueue extends LinkedBlockingQueue<Runnable> { return super.offer(o); //forces the item onto the queue, to be used if the task is rejected } + + /** + * Used to add a task to the queue if the task has been rejected by the Executor. + * + * @param o The task to add to the queue + * @param timeout The timeout to use when adding the task + * @param unit The units in which the timeout is expressed + * + * @return {@code true} if the task was added to the queue, + * otherwise {@code false} + * + * @throws InterruptedException If the call is interrupted before the + * timeout expires + * + * @deprecated Unused. Will be removed in Tomcat 10.1.x. + */ + @Deprecated public boolean force(Runnable o, long timeout, TimeUnit unit) throws InterruptedException { if (parent == null || parent.isShutdown()) { throw new RejectedExecutionException(sm.getString("taskQueue.notRunning")); @@ -73,6 +99,7 @@ public class TaskQueue extends LinkedBlockingQueue<Runnable> { return super.offer(o,timeout,unit); //forces the item onto the queue, to be used if the task is rejected } + @Override public boolean offer(Runnable o) { //we can't do any checks --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org