You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by pd...@apache.org on 2006/07/08 18:15:09 UTC

svn commit: r420159 - in /incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi: IsDeployedTask.java JbiProjectDeployerMojo.java

Author: pdodds
Date: Sat Jul  8 09:15:08 2006
New Revision: 420159

URL: http://svn.apache.org/viewvc?rev=420159&view=rev
Log:
Fixed the handling of determing whether an SA is deployed and also added a shutdown task so the SA is stopped and shutdown before redeploying

Modified:
    incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java
    incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java

Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java?rev=420159&r1=420158&r2=420159&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java Sat Jul  8 09:15:08 2006
@@ -25,13 +25,14 @@
 		this.deployed = deployed;
 	}
 
-	protected void doExecute(AdminCommandsServiceMBean acs) throws Exception {		
+	protected void doExecute(AdminCommandsServiceMBean acs) throws Exception {
 		if (JBI_SHARED_LIBRARY.equals(type)) {
 			String result = acs.listSharedLibraries(null, name);
 			setDeployed(isResultContaining(result, "shared-library", name));
 		} else if (JBI_SERVICE_ASSEMBLY.equals(type)) {
 			String result = acs.listServiceAssemblies(null, null, name);
-			setDeployed(isResultContaining(result, "service-assembly", name));
+			setDeployed(result.contains("<service-assembly-info name='" + name
+					+ "'"));
 		}
 		if (JBI_COMPONENT.equals(type)) {
 			String result = acs.listComponents(false, false, false, null, null,
@@ -45,7 +46,7 @@
 
 	private boolean isResultContaining(String result, String type, String name) {
 		String componentLine = "<component-info type='" + type + "' name='"
-				+ name + "'";		
+				+ name + "'";
 		return result.contains(componentLine);
 	}
 

Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java?rev=420159&r1=420158&r2=420159&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java Sat Jul  8 09:15:08 2006
@@ -37,6 +37,7 @@
 import org.apache.servicemix.jbi.management.task.InstallComponentTask;
 import org.apache.servicemix.jbi.management.task.InstallSharedLibraryTask;
 import org.apache.servicemix.jbi.management.task.ShutDownComponentTask;
+import org.apache.servicemix.jbi.management.task.ShutDownServiceAssemblyTask;
 import org.apache.servicemix.jbi.management.task.StartComponentTask;
 import org.apache.servicemix.jbi.management.task.StartServiceAssemblyTask;
 import org.apache.servicemix.jbi.management.task.StopComponentTask;
@@ -236,6 +237,11 @@
 			initializeJbiTask(stopTask);
 			stopTask.setName(jbiDeployable.getName());
 			stopTask.execute();
+
+			ShutDownServiceAssemblyTask shutdownTask = new ShutDownServiceAssemblyTask();
+			initializeJbiTask(shutdownTask);
+			shutdownTask.setName(jbiDeployable.getName());
+			shutdownTask.execute();
 		}
 		if (JBI_COMPONENT.equals(jbiDeployable.getType())) {
 			StopComponentTask stopTask = new StopComponentTask();