You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2011/04/20 16:19:00 UTC

svn commit: r1095421 - in /tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin: TuscanyStartMojo.java TuscanyStopMojo.java

Author: antelder
Date: Wed Apr 20 14:19:00 2011
New Revision: 1095421

URL: http://svn.apache.org/viewvc?rev=1095421&view=rev
Log:
No code changes just format the code

Modified:
    tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStartMojo.java
    tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStopMojo.java

Modified: tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStartMojo.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStartMojo.java?rev=1095421&r1=1095420&r2=1095421&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStartMojo.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStartMojo.java Wed Apr 20 14:19:00 2011
@@ -34,22 +34,23 @@ import org.apache.tuscany.sca.TuscanyRun
 import org.apache.tuscany.sca.shell.Shell;
 
 /**
- * Maven Mojo to start a Tuscany runtime and install the project as an SCA contribution.
- * 
- * Invoked with "mvn tuscany:start" usually from configuration in a module pom.xml
+ * Maven Mojo to start a Tuscany runtime and install the project as an SCA
+ * contribution. Invoked with "mvn tuscany:start" usually from configuration in
+ * a module pom.xml
  * 
  * @goal start
  * @requiresDependencyResolution runtime
  * @execute phase="test-compile"
- * @description Start a Tuscany directly and run composites from a SCA conribution maven project
+ * @description Start a Tuscany directly and run composites from a SCA
+ *              conribution maven project
  */
 public class TuscanyStartMojo extends AbstractMojo {
 
-	public static Map<String, TuscanyRuntime> runtimes = new HashMap<String, TuscanyRuntime>();
-	
+    public static Map<String, TuscanyRuntime> runtimes = new HashMap<String, TuscanyRuntime>();
+
     /**
      * The maven project.
-     *
+     * 
      * @parameter expression="${project}"
      * @required
      * @readonly
@@ -104,7 +105,7 @@ public class TuscanyStartMojo extends Ab
     private String nodeConfig;
 
     /**
-     * @parameter expression="${contributions}" 
+     * @parameter expression="${contributions}"
      */
     private String[] contributions;
 
@@ -122,13 +123,13 @@ public class TuscanyStartMojo extends Ab
 
         contributionList.add(0, "-help");
         contributionList.add(0, domainURI);
-        
+
         try {
             Shell.main(contributionList.toArray(new String[contributionList.size()]));
         } catch (Exception e) {
             throw new MojoExecutionException("Exception in Shell", e);
         }
-        
+
         getLog().info("Tuscany Shell stopped.");
     }
 
@@ -140,7 +141,7 @@ public class TuscanyStartMojo extends Ab
                 } else {
                     boolean found = false;
                     for (Object o : project.getDependencyArtifacts()) {
-                        Artifact a = (Artifact) o;
+                        Artifact a = (Artifact)o;
                         if (a.getId().startsWith(s)) {
                             try {
                                 contributionList.add(a.getFile().toURI().toURL().toString());
@@ -169,11 +170,11 @@ public class TuscanyStartMojo extends Ab
             if (!contributionFile.exists()) {
                 contributionFile = new File(buildDirectory.getParent(), finalName.getName() + packaging);
             }
-            
+
             String contribution = contributionFile.toURI().toURL().toString();
             getLog().info("Project contribution: " + contribution);
             cs.add(contribution);
-            
+
         } catch (MalformedURLException e) {
             throw new MojoExecutionException("", e);
         }

Modified: tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStopMojo.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStopMojo.java?rev=1095421&r1=1095420&r2=1095421&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStopMojo.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyStopMojo.java Wed Apr 20 14:19:00 2011
@@ -38,22 +38,22 @@ public class TuscanyStopMojo extends Abs
     private String id;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
-    	if (id.length() < 1) {
-    		// if id is set to "" then stop all runtimes
-    		for (String id : TuscanyStartMojo.runtimes.keySet()) {
-            	TuscanyRuntime runtime = TuscanyStartMojo.runtimes.get(id);
-          		runtime.stop();
+        if (id.length() < 1) {
+            // if id is set to "" then stop all runtimes
+            for (String id : TuscanyStartMojo.runtimes.keySet()) {
+                TuscanyRuntime runtime = TuscanyStartMojo.runtimes.get(id);
+                runtime.stop();
                 getLog().info("stopped Tuscany runtime " + id);
-    		}
-        	TuscanyStartMojo.runtimes.clear();
-    	} else {
-        	TuscanyRuntime runtime = TuscanyStartMojo.runtimes.remove(id);
-        	if (runtime == null) {
+            }
+            TuscanyStartMojo.runtimes.clear();
+        } else {
+            TuscanyRuntime runtime = TuscanyStartMojo.runtimes.remove(id);
+            if (runtime == null) {
                 getLog().info("No started runtime found for ID " + id);
-        	} else {
-        		runtime.stop();
+            } else {
+                runtime.stop();
                 getLog().info("stopped Tuscany runtime " + id);
-        	}
-    	}
+            }
+        }
     }
 }