[jboss-svn-commits] JBL Code SVN: r31133 - labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jan 19 08:56:45 EST 2010


Author: kevin.conner at jboss.com
Date: 2010-01-19 08:56:44 -0500 (Tue, 19 Jan 2010)
New Revision: 31133

Modified:
   labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5DeploymentComponent.java
Log:
Harden the checking when undeploying: JBESB-3132

Modified: labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5DeploymentComponent.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5DeploymentComponent.java	2010-01-19 13:07:42 UTC (rev 31132)
+++ labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5DeploymentComponent.java	2010-01-19 13:56:44 UTC (rev 31133)
@@ -73,37 +73,39 @@
         	repositoryName = arr[i];
         }
         
-        DeploymentProgress stop = deployMgr.stop(repositoryName);
-        stop.run();
-        if (stop != null) {
-        	DeploymentStatus stopStatus = stop.getDeploymentStatus();        	
-        	if (stopStatus.isFailed()) {
-            	if ((stopStatus.getFailure() != null) && (stopStatus.getFailure().getCause() != null) 
-            		&& (stopStatus.getFailure().getCause() instanceof java.lang.NullPointerException)) {
-            		// If we get a NPE here, it means that the .esb deployment has already been deleted
-            		// Return here because otherwise JON will not update and remove the deployment
+        if (repositoryName != null) {
+            DeploymentProgress stop = deployMgr.stop(repositoryName);
+            if (stop != null) {
+                stop.run();
+            	DeploymentStatus stopStatus = stop.getDeploymentStatus();        	
+            	if (stopStatus.isFailed()) {
+                	if ((stopStatus.getFailure() != null) && (stopStatus.getFailure().getCause() != null) 
+                		&& (stopStatus.getFailure().getCause() instanceof java.lang.NullPointerException)) {
+                		// If we get a NPE here, it means that the .esb deployment has already been deleted
+                		// Return here because otherwise JON will not update and remove the deployment
+                		log.error("Failed to stop deployment '" + repositoryName + "'.", stopStatus.getFailure());
+    
+                		return;
+                	}
+            		
             		log.error("Failed to stop deployment '" + repositoryName + "'.", stopStatus.getFailure());
-
-            		return;
-            	}
-        		
-        		log.error("Failed to stop deployment '" + repositoryName + "'.", stopStatus.getFailure());
-        		throw new Exception("Failed to stop deployment '" + repositoryName + "' - cause: "
-        				+ stopStatus.getFailure());
-        	}        
+            		throw new Exception("Failed to stop deployment '" + repositoryName + "' - cause: "
+            				+ stopStatus.getFailure());
+            	}        
+            }
+            DeploymentProgress remove = deployMgr.remove(repositoryName);        
+            if (remove != null) {
+                remove.run();
+    	        DeploymentStatus status = remove.getDeploymentStatus();
+    	        if (status.isFailed()) {
+            		log.error("Failed to remove deployment '" + repositoryName + "'.", status.getFailure());
+            		throw new Exception("Failed to remove deployment '" + repositoryName + "' - cause: "
+            				+ status.getFailure());
+    	        }
+            } else {
+            	throw new RuntimeException("Did not find Deployment " + fullFileName);        	
+            }
         }
-        DeploymentProgress remove = deployMgr.remove(repositoryName);        
-        remove.run();
-        if (remove != null) {
-	        DeploymentStatus status = remove.getDeploymentStatus();
-	        if (status.isFailed()) {
-        		log.error("Failed to remove deployment '" + repositoryName + "'.", status.getFailure());
-        		throw new Exception("Failed to remove deployment '" + repositoryName + "' - cause: "
-        				+ status.getFailure());
-	        }
-        } else {
-        	throw new RuntimeException("Did not find Deployment " + fullFileName);        	
-        }
 
         ManagementView mView = profileServiceConnection.getManagementView();
         mView.load();



More information about the jboss-svn-commits mailing list