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:37:13 UTC
[tomcat] branch 9.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 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 ea432c4 Add deprecation since SingleThreadModel will be removed in Servlet 6.0
ea432c4 is described below
commit ea432c46c55172aacfb519f6eb435ad94294d198
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 33fcec2..6d41a5f 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -182,7 +182,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;
@@ -194,19 +197,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;
@@ -396,7 +408,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;
}
@@ -407,7 +422,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;
@@ -516,7 +534,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 c02cff3..a64137b 100644
--- a/java/org/apache/catalina/core/mbeans-descriptors.xml
+++ b/java/org/apache/catalina/core/mbeans-descriptors.xml
@@ -1595,7 +1595,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"
@@ -1627,7 +1627,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 430a635..12080d5 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -1224,6 +1224,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