geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r792240 - /geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
Date Wed, 08 Jul 2009 17:45:35 GMT
Author: gawor
Date: Wed Jul  8 17:45:35 2009
New Revision: 792240

URL: http://svn.apache.org/viewvc?rev=792240&view=rev
Log:
properly enable/disable registered servers in the monitoring portlet. Patch from Kan Ogawa
(GERONIMO-4532)

Modified:
    geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java

Modified: geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java?rev=792240&r1=792239&r2=792240&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
(original)
+++ geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
Wed Jul  8 17:45:35 2009
@@ -252,7 +252,7 @@
         }
     }
 
-    private void alterServerState(String server_id, boolean b, PortletRequest request) {
+    private void alterServerState(String server_id, boolean enable, PortletRequest request)
{
         Connection conn = (new DBManager()).getConnection();
         String name = "";
         try {
@@ -267,28 +267,29 @@
             conn.close();
             conn = (new DBManager()).getConnection();
             Statement stmt = conn.createStatement();
-            if (b) {
+            if (enable) {
                 stmt
-                        .executeUpdate("UPDATE SERVERS SET ENABLED = 0 WHERE SERVER_ID="
+                        .executeUpdate("UPDATE SERVERS SET ENABLED = 1 WHERE SERVER_ID="
                                 + server_id);
                 stmt
-                        .executeUpdate("UPDATE GRAPHS SET ENABLED = 0 WHERE SERVER_ID="
+                        .executeUpdate("UPDATE GRAPHS SET ENABLED = 1 WHERE SERVER_ID="
                                 + server_id);
                 addInfoMessage(request, MessageFormat.format(getLocalizedString(request,
"infoMsg02"), name));
             } else {
                 stmt
-                        .executeUpdate("UPDATE SERVERS SET ENABLED = 1 WHERE SERVER_ID="
+                        .executeUpdate("UPDATE SERVERS SET ENABLED = 0 WHERE SERVER_ID="
                                 + server_id);
                 stmt
-                        .executeUpdate("UPDATE GRAPHS SET ENABLED = 1 WHERE SERVER_ID="
+                        .executeUpdate("UPDATE GRAPHS SET ENABLED = 0 WHERE SERVER_ID="
                                 + server_id);
                 addInfoMessage(request, MessageFormat.format(getLocalizedString(request,
"infoMsg03"), name));
             }
         } catch (SQLException e) {
-            if (b)
+            if (enable) {
                 addErrorMessage(request, MessageFormat.format(getLocalizedString(request,
"errorMsg02"), server_id), e.getMessage());
-            else
+            } else {
                 addErrorMessage(request, MessageFormat.format(getLocalizedString(request,
"errorMsg03"), server_id), e.getMessage());
+            }
         } finally {
             if (conn != null) {
                 try {



Mime
View raw message