tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r400267 - in /incubator/tuscany/java/sca/containers/container.rhino/src: main/java/org/apache/tuscany/container/rhino/assembly/ main/java/org/apache/tuscany/container/rhino/assembly/impl/ main/java/org/apache/tuscany/container/rhino/loader/...
Date Sat, 06 May 2006 08:41:39 GMT
Author: antelder
Date: Sat May  6 01:41:37 2006
New Revision: 400267

URL: http://svn.apache.org/viewcvs?rev=400267&view=rev
Log:
Fix for TUSCANY-221, chg from factory/interface/impl to single JavaScriptImplementation class

Removed:
    incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/JavaScriptAssemblyFactory.java
    incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/impl/JavaScriptAssemblyFactoryImpl.java
    incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/impl/JavaScriptImplementationImpl.java
Modified:
    incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/JavaScriptImplementation.java
    incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/loader/JavaScriptImplementationLoader.java
    incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/assembly/impl/JavaScriptImplementationTestCase.java
    incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/mock/MockAssemblyFactory.java

Modified: incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/JavaScriptImplementation.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/JavaScriptImplementation.java?rev=400267&r1=400266&r2=400267&view=diff
==============================================================================
--- incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/JavaScriptImplementation.java
(original)
+++ incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/assembly/JavaScriptImplementation.java
Sat May  6 01:41:37 2006
@@ -16,35 +16,69 @@
  */
 package org.apache.tuscany.container.rhino.assembly;
 
-import org.apache.tuscany.model.assembly.AtomicImplementation;
-import org.apache.tuscany.model.assembly.Implementation;
 import org.apache.tuscany.common.resource.ResourceLoader;
+import org.apache.tuscany.model.assembly.impl.AtomicImplementationImpl;
+
 import commonj.sdo.helper.TypeHelper;
 
 /**
- * A representation of a JavaScript component implementation type
- * 
+ * Default implementation of a JavScript component implementation type
+ *
  * @version $Rev$ $Date$
  */
-public interface JavaScriptImplementation extends AtomicImplementation {
+public class JavaScriptImplementation extends AtomicImplementationImpl {
+
+    private String scriptFile;
+
+    private String style;
+
+    private String script;
+
+    private ResourceLoader resourceLoader;
+
+    private TypeHelper typeHelper;
+
+    public JavaScriptImplementation() {
+        super();
+    }
 
-    public String getScriptFile();
+    public void setResourceLoader(ResourceLoader resourceLoader) {
+        this.resourceLoader = resourceLoader;
+    }
 
-    public void setScriptFile(String fn);
+    public ResourceLoader getResourceLoader() {
+        return resourceLoader;
+    }
 
-    public String getStyle();
+    public TypeHelper getTypeHelper() {
+        return typeHelper;
+    }
 
-    public void setStyle(String style);
+    public void setTypeHelper(TypeHelper typeHelper) {
+        this.typeHelper = typeHelper;
+    }
 
-    String getScript();
+    public String getScriptFile() {
+        return scriptFile;
+    }
 
-    void setScript(String script);
+    public void setScriptFile(String fn) {
+        scriptFile = fn;
+    }
 
-    void setResourceLoader(ResourceLoader resourceLoader);
+    public String getStyle() {
+        return this.style;
+    }
 
-    ResourceLoader getResourceLoader();
+    public void setStyle(String style) {
+        this.style = style;
+    }
 
-    TypeHelper getTypeHelper();
+    public String getScript() {
+        return script;
+    }
 
-    void setTypeHelper(TypeHelper typeHelper);
+    public void setScript(String script) {
+        this.script = script;
+    }
 }

Modified: incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/loader/JavaScriptImplementationLoader.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/loader/JavaScriptImplementationLoader.java?rev=400267&r1=400266&r2=400267&view=diff
==============================================================================
--- incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/loader/JavaScriptImplementationLoader.java
(original)
+++ incubator/tuscany/java/sca/containers/container.rhino/src/main/java/org/apache/tuscany/container/rhino/loader/JavaScriptImplementationLoader.java
Sat May  6 01:41:37 2006
@@ -19,38 +19,35 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLInputFactory;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
 
 import org.apache.tuscany.common.resource.ResourceLoader;
-import org.apache.tuscany.container.rhino.assembly.JavaScriptAssemblyFactory;
 import org.apache.tuscany.container.rhino.assembly.JavaScriptImplementation;
-import org.apache.tuscany.container.rhino.assembly.impl.JavaScriptAssemblyFactoryImpl;
 import org.apache.tuscany.core.config.ConfigurationLoadException;
-import org.apache.tuscany.core.config.MissingResourceException;
 import org.apache.tuscany.core.config.InvalidRootElementException;
+import org.apache.tuscany.core.config.MissingResourceException;
 import org.apache.tuscany.core.config.SidefileLoadException;
+import org.apache.tuscany.core.loader.LoaderContext;
 import org.apache.tuscany.core.loader.StAXElementLoader;
 import org.apache.tuscany.core.loader.StAXLoaderRegistry;
-import org.apache.tuscany.core.loader.LoaderContext;
 import org.apache.tuscany.core.loader.assembly.AssemblyConstants;
 import org.apache.tuscany.core.system.annotation.Autowire;
 import org.apache.tuscany.model.assembly.ComponentInfo;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Scope;
 
 /**
  * @version $Rev$ $Date$
  */
 @Scope("MODULE")
 public class JavaScriptImplementationLoader implements StAXElementLoader<JavaScriptImplementation>
{
-    public static final QName IMPLEMENTATION_JS = new QName("http://org.apache.tuscany/xmlns/js/0.9",
"implementation.js");
 
-    private static final JavaScriptAssemblyFactory factory = new JavaScriptAssemblyFactoryImpl();
+    public static final QName IMPLEMENTATION_JS = new QName("http://org.apache.tuscany/xmlns/js/0.9",
"implementation.js");
 
     protected StAXLoaderRegistry registry;
 
@@ -82,7 +79,7 @@
         String script = loadScript(scriptFile, loaderContext.getResourceLoader());
         ComponentInfo componentType = loadComponentType(scriptFile, loaderContext);
 
-        JavaScriptImplementation jsImpl = factory.createJavaScriptImplementation();
+        JavaScriptImplementation jsImpl = new JavaScriptImplementation();
         jsImpl.setComponentInfo(componentType);
         jsImpl.setScriptFile(scriptFile);
         jsImpl.setStyle(style);

Modified: incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/assembly/impl/JavaScriptImplementationTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/assembly/impl/JavaScriptImplementationTestCase.java?rev=400267&r1=400266&r2=400267&view=diff
==============================================================================
--- incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/assembly/impl/JavaScriptImplementationTestCase.java
(original)
+++ incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/assembly/impl/JavaScriptImplementationTestCase.java
Sat May  6 01:41:37 2006
@@ -16,11 +16,10 @@
  */
 package org.apache.tuscany.container.rhino.assembly.impl;
 
-import org.apache.tuscany.container.rhino.assembly.impl.JavaScriptAssemblyFactoryImpl;
-import org.apache.tuscany.container.rhino.assembly.impl.JavaScriptImplementationImpl;
-
 import junit.framework.TestCase;
 
+import org.apache.tuscany.container.rhino.assembly.JavaScriptImplementation;
+
 /**
  * FIXME commented out until SCDL loading works
  * 
@@ -28,8 +27,7 @@
  */
 public class JavaScriptImplementationTestCase extends TestCase {
 
-    private JavaScriptImplementationImpl impl = (JavaScriptImplementationImpl) new JavaScriptAssemblyFactoryImpl()
-            .createJavaScriptImplementation();
+    private JavaScriptImplementation impl = (JavaScriptImplementation) new JavaScriptImplementation();
     private ClassLoader origLoader;
 
     public void testDummy(){} // remove when tests added back

Modified: incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/mock/MockAssemblyFactory.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/mock/MockAssemblyFactory.java?rev=400267&r1=400266&r2=400267&view=diff
==============================================================================
--- incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/mock/MockAssemblyFactory.java
(original)
+++ incubator/tuscany/java/sca/containers/container.rhino/src/test/java/org/apache/tuscany/container/rhino/mock/MockAssemblyFactory.java
Sat May  6 01:41:37 2006
@@ -18,30 +18,23 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.List;
 
 import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl;
-import org.apache.tuscany.container.rhino.assembly.JavaScriptAssemblyFactory;
 import org.apache.tuscany.container.rhino.assembly.JavaScriptImplementation;
-import org.apache.tuscany.container.rhino.assembly.impl.JavaScriptAssemblyFactoryImpl;
-import org.apache.tuscany.core.context.CompositeContext;
-import org.apache.tuscany.core.context.impl.CompositeContextImpl;
-import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory;
-import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl;
-import org.apache.tuscany.core.system.context.SystemCompositeContextImpl;
 import org.apache.tuscany.core.config.ComponentTypeIntrospector;
 import org.apache.tuscany.core.config.ConfigurationLoadException;
 import org.apache.tuscany.core.config.processor.ProcessorUtils;
-import org.apache.tuscany.core.config.impl.Java5ComponentTypeIntrospector;
-import org.apache.tuscany.core.extension.config.ImplementationProcessor;
+import org.apache.tuscany.core.context.CompositeContext;
+import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory;
+import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl;
 import org.apache.tuscany.model.assembly.AtomicComponent;
 import org.apache.tuscany.model.assembly.Component;
 import org.apache.tuscany.model.assembly.ConfiguredService;
 import org.apache.tuscany.model.assembly.Module;
 import org.apache.tuscany.model.assembly.Scope;
 import org.apache.tuscany.model.assembly.Service;
-import org.apache.tuscany.model.assembly.ComponentInfo;
 import org.apache.tuscany.model.assembly.impl.AssemblyContextImpl;
+import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl;
 import org.apache.tuscany.model.types.java.JavaServiceContract;
 
 /**
@@ -51,7 +44,7 @@
  */
 public class MockAssemblyFactory {
 
-    private static JavaScriptAssemblyFactory factory = new JavaScriptAssemblyFactoryImpl();
+    private static AssemblyFactoryImpl factory = new AssemblyFactoryImpl();
 
     private static SystemAssemblyFactory systemFactory = new SystemAssemblyFactoryImpl();
     private static ComponentTypeIntrospector introspector;
@@ -65,7 +58,7 @@
 
     public static AtomicComponent createComponent(String name, String scriptFile, Class type,
Scope scope) {
         AtomicComponent sc = factory.createSimpleComponent();
-        JavaScriptImplementation impl = factory.createJavaScriptImplementation();
+        JavaScriptImplementation impl = new JavaScriptImplementation();
         impl.setComponentInfo(factory.createComponentInfo());
         impl.setScriptFile(scriptFile);
         impl.setScript(readScript(type.getClassLoader().getResourceAsStream(scriptFile)));



Mime
View raw message