You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/07/21 16:25:35 UTC
[tomcat] branch 9.0.x updated: Deprecate unused method. Improve
Javadoc.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new f5146f6 Deprecate unused method. Improve Javadoc.
f5146f6 is described below
commit f5146f694698b3b53cdb19e940bc03d862caa33f
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org