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/09/21 11:36:30 UTC
[tomcat] branch 10.0.x updated: Add deprecation since
SingleThreadModel will be removed in Servlet 6.0
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new 8971fdb Add deprecation since SingleThreadModel will be removed in Servlet 6.0
8971fdb is described below
commit 8971fdb4155cc794b1c193ca94d8ff66d9b3a4eb
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Sep 21 12:36:23 2021 +0100
Add deprecation since SingleThreadModel will be removed in Servlet 6.0
---
java/org/apache/catalina/core/StandardWrapper.java | 21 +++++++++++++++++++++
.../org/apache/catalina/core/mbeans-descriptors.xml | 4 ++--
java/org/apache/catalina/startup/Tomcat.java | 1 +
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java
index 733deff..f40f487 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -183,7 +183,10 @@ public class StandardWrapper extends ContainerBase
/**
* Does this servlet implement the SingleThreadModel interface?
+ *
+ * @deprecated This will be removed in Tomcat 10.1 onwards.
*/
+ @Deprecated
protected volatile boolean singleThreadModel = false;
@@ -195,19 +198,28 @@ public class StandardWrapper extends ContainerBase
/**
* Maximum number of STM instances.
+ *
+ * @deprecated This will be removed in Tomcat 10.1 onwards.
*/
+ @Deprecated
protected int maxInstances = 20;
/**
* Number of instances currently loaded for a STM servlet.
+ *
+ * @deprecated This will be removed in Tomcat 10.1 onwards.
*/
+ @Deprecated
protected int nInstances = 0;
/**
* Stack containing the STM instances.
+ *
+ * @deprecated This will be removed in Tomcat 10.1 onwards.
*/
+ @Deprecated
protected Stack<Servlet> instancePool = null;
@@ -397,7 +409,10 @@ public class StandardWrapper extends ContainerBase
/**
* @return maximum number of instances that will be allocated when a single
* thread model servlet is used.
+ *
+ * @deprecated This will be removed in Tomcat 10.1 onwards.
*/
+ @Deprecated
public int getMaxInstances() {
return this.maxInstances;
}
@@ -408,7 +423,10 @@ public class StandardWrapper extends ContainerBase
* thread model servlet is used.
*
* @param maxInstances New value of maxInstances
+ *
+ * @deprecated This will be removed in Tomcat 10.1 onwards.
*/
+ @Deprecated
public void setMaxInstances(int maxInstances) {
int oldMaxInstances = this.maxInstances;
@@ -517,7 +535,10 @@ public class StandardWrapper extends ContainerBase
* @return {@code null} if the class has not been loaded, otherwise {@code
* true} if the servlet does implement {@code SingleThreadModel} and
* {@code false} if it does not.
+ *
+ * @deprecated This will be removed in Tomcat 10.1 onwards.
*/
+ @Deprecated
public Boolean isSingleThreadModel() {
// If the servlet has been loaded either singleThreadModel will be true
// or instance will be non-null
diff --git a/java/org/apache/catalina/core/mbeans-descriptors.xml b/java/org/apache/catalina/core/mbeans-descriptors.xml
index 5a706a6..a04ccbe 100644
--- a/java/org/apache/catalina/core/mbeans-descriptors.xml
+++ b/java/org/apache/catalina/core/mbeans-descriptors.xml
@@ -1599,7 +1599,7 @@
writeable="false" />
<attribute name="maxInstances"
- description="Maximum number of STM instances."
+ description="Deprecated. Will be removed in Tomcat 10.1 onwards. Maximum number of STM instances."
type="int" />
<attribute name="minTime"
@@ -1631,7 +1631,7 @@
writeable="false" />
<attribute name="singleThreadModel"
- description="Does this servlet implement the SingleThreadModel interface?"
+ description="Deprecated. Will be removed in Tomcat 10.1 onwards. Does this servlet implement the SingleThreadModel interface?"
type="java.lang.Boolean"
is="true"
writeable="false" />
diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java
index e5565d1..f1045c2 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -1221,6 +1221,7 @@ public class Tomcat {
return result;
}
+ @SuppressWarnings("deprecation")
@Override
public synchronized Servlet loadServlet() throws ServletException {
if (singleThreadModel) {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org