tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmar...@apache.org
Subject svn commit: r440925 - in /incubator/tuscany/java/samples/sca/spring/client: ./ src/main/java/sample/ src/main/webapp/ src/main/webapp/META-INF/sca/ src/main/webapp/META-INF/tuscany.extensions/ src/main/webapp/WEB-INF/classes/
Date Thu, 07 Sep 2006 01:15:59 GMT
Author: jmarino
Date: Wed Sep  6 18:15:58 2006
New Revision: 440925

URL: http://svn.apache.org/viewvc?view=rev&rev=440925
Log:
update Spring sample to work with test reference  binding; now works end-to-end 

Added:
    incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java
  (with props)
    incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java
  (with props)
    incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/tuscany.extensions/test.binding.system.scdl
Removed:
    incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestBeanImpl.java
Modified:
    incubator/tuscany/java/samples/sca/spring/client/pom.xml
    incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestBean.java
    incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/sca/default.scdl
    incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/WEB-INF/classes/application-context.xml
    incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/test.jsp

Modified: incubator/tuscany/java/samples/sca/spring/client/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/pom.xml?view=diff&rev=440925&r1=440924&r2=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/pom.xml (original)
+++ incubator/tuscany/java/samples/sca/spring/client/pom.xml Wed Sep  6 18:15:58 2006
@@ -40,7 +40,8 @@
             <groupId>org.apache.tuscany</groupId>
             <artifactId>core</artifactId>
             <version>${pom.version}</version>
-            <scope>runtime</scope> <!-- runtime is need for webapp integration
to include jar -->
+            <scope>runtime</scope>
+            <!-- runtime is need for webapp integration to include jar -->
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
@@ -51,13 +52,15 @@
             <groupId>org.apache.tuscany.runtime</groupId>
             <artifactId>webapp</artifactId>
             <version>${pom.version}</version>
-            <scope>runtime</scope> <!-- runtime is need for webapp integration
to include jar -->
+            <scope>runtime</scope>
+            <!-- runtime is need for webapp integration to include jar -->
         </dependency>
         <dependency>
             <groupId>org.apache.tuscany.runtime</groupId>
             <artifactId>webapp-host</artifactId>
             <version>${pom.version}</version>
-            <scope>runtime</scope> <!-- runtime is need for webapp integration
to include jar -->
+            <scope>runtime</scope>
+            <!-- runtime is need for webapp integration to include jar -->
         </dependency>
         <dependency>
             <groupId>org.apache.tuscany.containers</groupId>
@@ -65,18 +68,24 @@
             <version>${pom.version}</version>
             <scope>runtime</scope>
         </dependency>
-		  <dependency>
+        <dependency>
+            <groupId>org.apache.tuscany</groupId>
+            <artifactId>test</artifactId>
+            <version>${sca.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring</artifactId>
             <version>2.0-rc3</version>
             <scope>compile</scope>
         </dependency>
-			<dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>3.8.1</version>
             <scope>test</scope>
         </dependency>
-        
+
     </dependencies>
 </project>

Modified: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestBean.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestBean.java?view=diff&rev=440925&r1=440924&r2=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestBean.java (original)
+++ incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestBean.java Wed
Sep  6 18:15:58 2006
@@ -3,5 +3,6 @@
 /**
  * @version $Rev$ $Date$
  */
-public class TestBean {
+public interface TestBean {
+  TestComponent getTestComponent();
 }

Added: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java?view=auto&rev=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java
(added)
+++ incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java
Wed Sep  6 18:15:58 2006
@@ -0,0 +1,7 @@
+package sample;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface TestComponent {
+}

Propchange: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java?view=auto&rev=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java
(added)
+++ incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java
Wed Sep  6 18:15:58 2006
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+public class TestComponentImpl implements TestComponent {
+
+
+}

Propchange: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/tuscany/java/samples/sca/spring/client/src/main/java/sample/TestComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/sca/default.scdl?view=diff&rev=440925&r1=440924&r2=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/sca/default.scdl
(original)
+++ incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/sca/default.scdl
Wed Sep  6 18:15:58 2006
@@ -20,18 +20,14 @@
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="SpringSample">
     <component name="SpringSample">
         <implementation.spring location="application-context.xml">
-           <!-- <service name="fooService">
-                <binding.test/>
-                <interface.java class="org.apache.tuscany.container.spring.mock.TestBean"/>
-                <reference>testBean</reference>
-            </service>
             <reference name="testReference">
-                <interface.java class="org.apache.tuscany.container.spring.mock.TestBean"/>
+                <interface.java interface="sample.TestComponent"/>
                 <binding.test/>
-            </reference>          -->
+            </reference>
         </implementation.spring>
-
     </component>
 
-
+    <component name="ScaComponent">
+        <implementation.java class="sample.TestComponentImpl"/>
+    </component>
 </composite>

Added: incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/tuscany.extensions/test.binding.system.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/tuscany.extensions/test.binding.system.scdl?view=auto&rev=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/tuscany.extensions/test.binding.system.scdl
(added)
+++ incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/META-INF/tuscany.extensions/test.binding.system.scdl
Wed Sep  6 18:15:58 2006
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<!--
+    JavaScript configuration for the launcher environment.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+
+           name="org.apache.tuscany.test.TestBindingImplementation">
+
+    <component name="BindingLoader">
+        <system:implementation.system class="org.apache.tuscany.test.binding.TestBindingLoader"/>
+    </component>
+
+    <component name="BindingBuilder">
+        <system:implementation.system class="org.apache.tuscany.test.binding.TestBindingBuilder"/>
+    </component>
+
+</composite>

Modified: incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/WEB-INF/classes/application-context.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/WEB-INF/classes/application-context.xml?view=diff&rev=440925&r1=440924&r2=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/WEB-INF/classes/application-context.xml
(original)
+++ incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/WEB-INF/classes/application-context.xml
Wed Sep  6 18:15:58 2006
@@ -4,10 +4,12 @@
        xmlns:sca="http://www.springframework.org/schema/sca"
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/SpringSCA.xsd">
+http://www.springframework.org/schema/sca http://bjlinux15/tuscany/spring-sca.xsd">
 
     <bean id="testBean" class="sample.TestBeanImpl" lazy-init="true">
-        <!--<property name="bean" ref="testReference"/>-->
+        <property name="testComponent" ref="testReference"/>
     </bean>
+
+  <!--<sca:reference name="testReference" type="sample.TestComponent"/>   -->
 
 </beans>

Modified: incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/test.jsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/test.jsp?view=diff&rev=440925&r1=440924&r2=440925
==============================================================================
--- incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/test.jsp (original)
+++ incubator/tuscany/java/samples/sca/spring/client/src/main/webapp/test.jsp Wed Sep  6 18:15:58
2006
@@ -1,6 +1,6 @@
 <%@ page import="org.osoa.sca.CompositeContext" %>
 <%@ page import="org.osoa.sca.CurrentCompositeContext" %>
-<%@ page import="sample.TestBean"%>
+<%@ page import="sample.TestBean" %>
 <%--
 
 Demonstrates accessing the current application context
@@ -13,6 +13,13 @@
 <%
     CompositeContext context = CurrentCompositeContext.getContext();
     // locates a bean in the Spring context
-    System.out.println("bean:" + context.locateService(TestBean.class, "testBean"));
+
+    TestBean testBean = context.locateService(TestBean.class, "testBean");
+    System.out.println("component" + (testBean.getTestComponent() != null));
+    System.out.println("bean:" + testBean);
+
+    System.out.println("component: " + context.locateService(TestBean.class, "ScaComponent"));
+
+    System.out.println("injected component: " + testBean.getTestComponent());
 %>
 </html>



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


Mime
View raw message