geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r807933 - /geronimo/server/branches/2.2/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
Date Wed, 26 Aug 2009 09:09:20 GMT
Author: xuhaihong
Date: Wed Aug 26 09:09:19 2009
New Revision: 807933

URL: http://svn.apache.org/viewvc?rev=807933&view=rev
Log:
GERONIMO-4816 Status of monitoring servers will remain the same as previous when recreated


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

Modified: geronimo/server/branches/2.2/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java?rev=807933&r1=807932&r2=807933&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
(original)
+++ geronimo/server/branches/2.2/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
Wed Aug 26 09:09:19 2009
@@ -679,13 +679,22 @@
         try {
             userTransaction.begin();
             try {
-            	Node node = entityManager.find(Node.class, server_id);
-            	// check if there is any graph created against the node before delete it.
-            	List<Graph> graphs = entityManager.createNamedQuery("graphsByNode").setParameter("name",
node.getName()).getResultList();
-            	if (!(graphs == null || graphs.isEmpty())) {
-            		addErrorMessage(actionRequest, getLocalizedString(actionRequest, "mconsole.errorMsg20"));
-            		return;
-            	} 
+                Node node = entityManager.find(Node.class, server_id);
+                // check if there is any graph created against the node before delete it.
+                List<Graph> graphs = entityManager.createNamedQuery("graphsByNode").setParameter("name",
node.getName()).getResultList();
+                if (!(graphs == null || graphs.isEmpty())) {
+                    addErrorMessage(actionRequest, getLocalizedString(actionRequest, "mconsole.errorMsg20"));
+                    return;
+                }
+                // check whether the snapshot query is enabled, if does, close it first
+                MRCConnector mrc = new MRCConnector(node);
+                if (mrc.isSnapshotRunning() == 1) {
+                    if (mrc.stopSnapshotThread()) {
+                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "mconsole.infoMsg06",
server_id));
+                    } else {
+                        addErrorMessage(actionRequest, getLocalizedString(actionRequest,
"mconsole.errorMsg09", server_id));
+                    }
+                }
                 entityManager.remove(node);
             } finally {
                 userTransaction.commit();



Mime
View raw message