You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2007/02/10 19:49:01 UTC

svn commit: r505742 - in /incubator/tuscany/java/sca: plugins/ runtime/ runtime/itest/ runtime/itest/src/ runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/

Author: jboynes
Date: Sat Feb 10 10:49:00 2007
New Revision: 505742

URL: http://svn.apache.org/viewvc?view=rev&rev=505742
Log:
move itest plugin to runtime
fix itest plugin so it compiles but is not yet ported to 1.0 programming model
remove plugins as it is now empty

Added:
    incubator/tuscany/java/sca/runtime/itest/
      - copied from r505732, incubator/tuscany/java/sca/plugins/plugin.itest/
    incubator/tuscany/java/sca/runtime/itest/LICENSE.txt
      - copied unchanged from r505739, incubator/tuscany/java/sca/plugins/plugin.itest/LICENSE.txt
    incubator/tuscany/java/sca/runtime/itest/NOTICE.txt
      - copied unchanged from r505739, incubator/tuscany/java/sca/plugins/plugin.itest/NOTICE.txt
    incubator/tuscany/java/sca/runtime/itest/pom.xml
      - copied, changed from r505739, incubator/tuscany/java/sca/plugins/plugin.itest/pom.xml
    incubator/tuscany/java/sca/runtime/itest/src/
      - copied from r505739, incubator/tuscany/java/sca/plugins/plugin.itest/src/
Removed:
    incubator/tuscany/java/sca/plugins/
Modified:
    incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenEmbeddedRuntime.java
    incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenRuntimeInfo.java
    incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/TuscanyStartMojo.java
    incubator/tuscany/java/sca/runtime/pom.xml

Copied: incubator/tuscany/java/sca/runtime/itest/pom.xml (from r505739, incubator/tuscany/java/sca/plugins/plugin.itest/pom.xml)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/itest/pom.xml?view=diff&rev=505742&p1=incubator/tuscany/java/sca/plugins/plugin.itest/pom.xml&r1=505739&p2=incubator/tuscany/java/sca/runtime/itest/pom.xml&r2=505742
==============================================================================
--- incubator/tuscany/java/sca/plugins/plugin.itest/pom.xml (original)
+++ incubator/tuscany/java/sca/runtime/itest/pom.xml Sat Feb 10 10:49:00 2007
@@ -19,7 +19,7 @@
 -->
 <project>
     <parent>
-        <groupId>org.apache.tuscany.sca.plugins</groupId>
+        <groupId>org.apache.tuscany.sca</groupId>
         <artifactId>parent</artifactId>
         <version>1.0-incubator-SNAPSHOT</version>
     </parent>

Modified: incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenEmbeddedRuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenEmbeddedRuntime.java?view=diff&rev=505742&r1=505739&r2=505742
==============================================================================
--- incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenEmbeddedRuntime.java (original)
+++ incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenEmbeddedRuntime.java Sat Feb 10 10:49:00 2007
@@ -18,35 +18,22 @@
  */
 package org.apache.tuscany.sca.plugin.itest;
 
-import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.osoa.sca.CompositeContext;
-
-import org.apache.tuscany.core.implementation.system.model.SystemCompositeImplementation;
-import org.apache.tuscany.core.launcher.CompositeContextImpl;
 import org.apache.tuscany.core.runtime.AbstractRuntime;
 import org.apache.tuscany.host.runtime.InitializationException;
 import org.apache.tuscany.sca.plugin.itest.TuscanyStartMojo.MavenEmbeddedArtifactRepository;
-import org.apache.tuscany.spi.builder.BuilderException;
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.ComponentException;
 import org.apache.tuscany.spi.component.ComponentRegistrationException;
 import org.apache.tuscany.spi.component.CompositeComponent;
-import org.apache.tuscany.spi.component.TargetResolutionException;
-import org.apache.tuscany.spi.deployer.CompositeClassLoader;
-import org.apache.tuscany.spi.deployer.Deployer;
-import org.apache.tuscany.spi.loader.LoaderException;
-import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.services.artifact.ArtifactRepository;
 
 /**
  * @version $Rev$ $Date$
  */
 public class MavenEmbeddedRuntime extends AbstractRuntime {
-    private CompositeContextImpl context;
     private CompositeComponent application;
 
     private ArtifactRepository artifactRepository;
@@ -60,13 +47,13 @@
     protected void registerSystemComponents() throws InitializationException {
         super.registerSystemComponents();
         try {
-            getSystemComponent().registerJavaObject(MavenRuntimeInfo.COMPONENT_NAME,
-                MavenRuntimeInfo.class,
-                (MavenRuntimeInfo) getRuntimeInfo());
-
-            getSystemComponent().registerJavaObject(MavenEmbeddedArtifactRepository.COMPONENT_NAME,
-                ArtifactRepository.class,
-                artifactRepository);
+            getComponentManager().registerJavaObject(MavenRuntimeInfo.COMPONENT_NAME,
+                                                     MavenRuntimeInfo.class,
+                                                     (MavenRuntimeInfo) getRuntimeInfo());
+
+            getComponentManager().registerJavaObject(URI.create(MavenEmbeddedArtifactRepository.COMPONENT_NAME),
+                                                     ArtifactRepository.class,
+                                                     artifactRepository);
         } catch (ComponentRegistrationException e) {
             throw new InitializationException(e);
         }
@@ -75,6 +62,7 @@
     public void initialize() throws InitializationException {
         super.initialize();
 
+/*
         try {
             for (Object extensionName : extensions.keySet()) {
                 deployExtension(getTuscanySystem(), getDeployer(), (String) extensionName, (URL) extensions.get(extensionName));
@@ -97,39 +85,37 @@
         } catch (ComponentException e) {
             throw new InitializationException(e);
         }
+*/
     }
 
-    protected void deployExtension(CompositeComponent composite, Deployer deployer, String extensionName, URL url)
-        throws LoaderException, BuilderException, ComponentException {
-        SystemCompositeImplementation implementation = new SystemCompositeImplementation();
-        URL scdlLocation;
-        try {
-            scdlLocation = new URL("jar:" + url.toExternalForm() + "!/META-INF/sca/default.scdl");
-        } catch (MalformedURLException e) {
-            throw new IllegalArgumentException(e);
-        }
+    /*
+        protected void deployExtension(CompositeComponent composite, Deployer deployer, String extensionName, URL url)
+            throws LoaderException, BuilderException, ComponentException {
+            SystemCompositeImplementation implementation = new SystemCompositeImplementation();
+            URL scdlLocation;
+            try {
+                scdlLocation = new URL("jar:" + url.toExternalForm() + "!/META-INF/sca/default.scdl");
+            } catch (MalformedURLException e) {
+                throw new IllegalArgumentException(e);
+            }
 
-        implementation.setScdlLocation(scdlLocation);
-        implementation.setClassLoader(new CompositeClassLoader(new URL[]{url}, getClass().getClassLoader()));
+            implementation.setScdlLocation(scdlLocation);
+            implementation.setClassLoader(new CompositeClassLoader(new URL[]{url}, getClass().getClassLoader()));
 
-        ComponentDefinition<SystemCompositeImplementation> definition =
-            new ComponentDefinition<SystemCompositeImplementation>(extensionName, implementation);
+            ComponentDefinition<SystemCompositeImplementation> definition =
+                new ComponentDefinition<SystemCompositeImplementation>(extensionName, implementation);
 
-        Component component = deployer.deploy(composite, definition);
-        component.start();
-    }
+            Component component = deployer.deploy(composite, definition);
+            component.start();
+        }
 
+    */
     public void destroy() {
-        context = null;
         if (application != null) {
             application.stop();
             application = null;
         }
         super.destroy();
-    }
-
-    public CompositeContext getContext() {
-        return context;
     }
 
     public void setArtifactRepository(ArtifactRepository artifactRepository) {

Modified: incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenRuntimeInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenRuntimeInfo.java?view=diff&rev=505742&r1=505739&r2=505742
==============================================================================
--- incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenRuntimeInfo.java (original)
+++ incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/MavenRuntimeInfo.java Sat Feb 10 10:49:00 2007
@@ -28,7 +28,7 @@
  * @version $Rev$ $Date$
  */
 public class MavenRuntimeInfo implements RuntimeInfo {
-    public static final String COMPONENT_NAME = "MavenRuntimeInfo";
+    public static final URI COMPONENT_NAME = URI.create("MavenRuntimeInfo");
     
     public File getInstallDirectory() {
         throw new UnsupportedOperationException();

Modified: incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/TuscanyStartMojo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/TuscanyStartMojo.java?view=diff&rev=505742&r1=505739&r2=505742
==============================================================================
--- incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/TuscanyStartMojo.java (original)
+++ incubator/tuscany/java/sca/runtime/itest/src/main/java/org/apache/tuscany/sca/plugin/itest/TuscanyStartMojo.java Sat Feb 10 10:49:00 2007
@@ -23,6 +23,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.URI;
 import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Iterator;
@@ -43,9 +44,6 @@
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.tuscany.host.runtime.InitializationException;
 
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-
 /**
  * @version $Rev$ $Date$
  * @goal start
@@ -297,8 +295,6 @@
         } catch (InitializationException e) {
             throw new MojoExecutionException("Error initializing", e);
         }
-        CompositeContext context = runtime.getContext();
-        CurrentCompositeContext.setContext(context);
 
         foo.set(applicationClassLoader);
     }

Modified: incubator/tuscany/java/sca/runtime/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/pom.xml?view=diff&rev=505742&r1=505741&r2=505742
==============================================================================
--- incubator/tuscany/java/sca/runtime/pom.xml (original)
+++ incubator/tuscany/java/sca/runtime/pom.xml Sat Feb 10 10:49:00 2007
@@ -35,6 +35,7 @@
         <module>services</module>
         <module>standalone</module>
         <module>webapp</module>
+        <module>itest</module>
     </modules>
 
 </project>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org