tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1390886 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/Context.java java/org/apache/catalina/core/StandardWrapperValve.java java/org/apache/catalina/manager/HTMLManagerServlet.java java/org/apache/catalina/manager/ManagerServlet.java
Date Thu, 27 Sep 2012 08:24:49 GMT
Author: markt
Date: Thu Sep 27 08:24:49 2012
New Revision: 1390886

URL: http://svn.apache.org/viewvc?rev=1390886&view=rev
Log:
Deprecate unnecessary code

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1390882

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java?rev=1390886&r1=1390885&r2=1390886&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java Thu Sep 27 08:24:49 2012
@@ -164,7 +164,12 @@ public interface Context extends Contain
 
     /**
      * Return the application available flag for this Context.
+     *
+     * @deprecated  This will be removed in Tomcat 8.0.x onwards. Use
+     *              {@link #getState()}.{@link LifecycleState#isAvailable()
+     *              isAvailable()} instead
      */
+    @Deprecated
     public boolean getAvailable();
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java?rev=1390886&r1=1390885&r2=1390886&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Thu Sep 27
08:24:49 2012
@@ -106,7 +106,7 @@ final class StandardWrapperValve
         Context context = (Context) wrapper.getParent();
         
         // Check for the application being marked unavailable
-        if (!context.getAvailable()) {
+        if (!context.getState().isAvailable()) {
             response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE,
                            sm.getString("standardContext.isUnavailable"));
             unavailable = true;
@@ -358,7 +358,8 @@ final class StandardWrapperValve
         Context context = (Context) wrapper.getParent();
 
         // Check for the application being marked unavailable
-        boolean unavailable = !context.getAvailable() || wrapper.isUnavailable();
+        boolean unavailable = !context.getState().isAvailable() ||
+                wrapper.isUnavailable();
         
         // Allocate a servlet instance to process this request
         try {

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java?rev=1390886&r1=1390885&r2=1390886&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java Thu Sep
27 08:24:49 2012
@@ -504,7 +504,7 @@ public final class HTMLManagerServlet ex
                 } else {
                     args[2] = RequestUtil.filter(ctxt.getDisplayName());
                 }
-                args[3] = Boolean.valueOf(ctxt.getAvailable());
+                args[3] = Boolean.valueOf(ctxt.getState().isAvailable());
                 args[4] = RequestUtil.filter(response.encodeURL(request.getContextPath()
+
                      "/html/sessions?" + pathVersion));
                 Manager manager = ctxt.getManager(); 
@@ -553,13 +553,13 @@ public final class HTMLManagerServlet ex
                 if (ctxt.getName().equals(this.context.getName())) {
                     writer.print(MessageFormat.format(
                         MANAGER_APP_ROW_BUTTON_SECTION, args));
-                } else if (ctxt.getAvailable() && isDeployed) {
+                } else if (ctxt.getState().isAvailable() && isDeployed) {
                     writer.print(MessageFormat.format(
                         STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION, args));
-                } else if (ctxt.getAvailable() && !isDeployed) {
+                } else if (ctxt.getState().isAvailable() && !isDeployed) {
                     writer.print(MessageFormat.format(
                         STARTED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION, args));
-                } else if (!ctxt.getAvailable() && isDeployed) {
+                } else if (!ctxt.getState().isAvailable() && isDeployed) {
                     writer.print(MessageFormat.format(
                         STOPPED_DEPLOYED_APPS_ROW_BUTTON_SECTION, args));
                 } else {

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1390886&r1=1390885&r2=1390886&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java Thu Sep 27 08:24:49
2012
@@ -863,10 +863,11 @@ public class ManagerServlet extends Http
                 }
             }
             context = (Context) host.findChild(name);
-            if (context != null && context.getConfigured() && context.getAvailable())
{
+            if (context != null && context.getConfigured() &&
+                    context.getState().isAvailable()) {
                 writer.println(smClient.getString(
                         "managerServlet.deployed", displayPath));
-            } else if (context!=null && !context.getAvailable()) {
+            } else if (context!=null && !context.getState().isAvailable()) {
                 writer.println(smClient.getString(
                         "managerServlet.deployedButNotStarted", displayPath));
             } else {
@@ -904,7 +905,7 @@ public class ManagerServlet extends Http
                 String displayPath = context.getPath();
                 if( displayPath.equals("") )
                     displayPath = "/";
-                if (context.getAvailable()) {
+                if (context.getState().isAvailable()) {
                     writer.println(smClient.getString("managerServlet.listitem",
                             displayPath,
                             "running",
@@ -1253,7 +1254,7 @@ public class ManagerServlet extends Http
                 return;
             }
             context.start();
-            if (context.getAvailable())
+            if (context.getState().isAvailable())
                 writer.println(smClient.getString("managerServlet.started",
                         displayPath));
             else



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message