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 ae0cefa Add deprecation since SingleThreadModel will be removed in Servlet 6.0 ae0cefa is described below commit ae0cefa98a899c16ba32b400c9673e06e38586c7 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 b5cf843..2388f3d 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 8856ef9..ca33d5e 100644 --- a/java/org/apache/catalina/core/mbeans-descriptors.xml +++ b/java/org/apache/catalina/core/mbeans-descriptors.xml @@ -1578,7 +1578,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" @@ -1610,7 +1610,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 50515dd..35b697f 100644 --- a/java/org/apache/catalina/startup/Tomcat.java +++ b/java/org/apache/catalina/startup/Tomcat.java @@ -1195,6 +1195,7 @@ public class Tomcat { return result; } + @SuppressWarnings("deprecation") @Override public synchronized Servlet loadServlet() throws ServletException { if (singleThreadModel) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org