You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/04/07 22:31:59 UTC

svn commit: r762942 - in /tuscany/java/sca: features/ejava/pom.xml pom.xml samples/dosgi-calculator-operations/pom.xml samples/dosgi-calculator/pom.xml samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java samples/pom.xml

Author: rfeng
Date: Tue Apr  7 20:31:59 2009
New Revision: 762942

URL: http://svn.apache.org/viewvc?rev=762942&view=rev
Log:
Fix the dependencies to get distributed OSGi samples working inside Eclipse

Modified:
    tuscany/java/sca/features/ejava/pom.xml
    tuscany/java/sca/pom.xml
    tuscany/java/sca/samples/dosgi-calculator-operations/pom.xml
    tuscany/java/sca/samples/dosgi-calculator/pom.xml
    tuscany/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
    tuscany/java/sca/samples/pom.xml

Modified: tuscany/java/sca/features/ejava/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/features/ejava/pom.xml?rev=762942&r1=762941&r2=762942&view=diff
==============================================================================
--- tuscany/java/sca/features/ejava/pom.xml (original)
+++ tuscany/java/sca/features/ejava/pom.xml Tue Apr  7 20:31:59 2009
@@ -106,6 +106,12 @@
             <version>2.0-SNAPSHOT</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.eclipse.osgi</groupId>
+            <artifactId>services</artifactId>
+            <version>3.1.200-v20071203</version>
+        </dependency>
+
 
         <!-- Policies -->
 <!--

Modified: tuscany/java/sca/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/pom.xml?rev=762942&r1=762941&r2=762942&view=diff
==============================================================================
--- tuscany/java/sca/pom.xml (original)
+++ tuscany/java/sca/pom.xml Tue Apr  7 20:31:59 2009
@@ -495,7 +495,7 @@
                         <dependency>
                             <groupId>org.apache.tuscany.maven.plugins</groupId>
                             <artifactId>maven-eclipse-compiler</artifactId>
-                            <version>1.0.2-SNAPSHOT</version>
+                            <version>1.0.1</version>
                             <scope>provided</scope>
                         </dependency>
                     </dependencies>

Modified: tuscany/java/sca/samples/dosgi-calculator-operations/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/dosgi-calculator-operations/pom.xml?rev=762942&r1=762941&r2=762942&view=diff
==============================================================================
--- tuscany/java/sca/samples/dosgi-calculator-operations/pom.xml (original)
+++ tuscany/java/sca/samples/dosgi-calculator-operations/pom.xml Tue Apr  7 20:31:59 2009
@@ -37,6 +37,20 @@
             <type>pom</type>
         </dependency>
 
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-launcher-equinox</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-impl-osgi</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.eclipse.osgi</groupId>
             <artifactId>services</artifactId>

Modified: tuscany/java/sca/samples/dosgi-calculator/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/dosgi-calculator/pom.xml?rev=762942&r1=762941&r2=762942&view=diff
==============================================================================
--- tuscany/java/sca/samples/dosgi-calculator/pom.xml (original)
+++ tuscany/java/sca/samples/dosgi-calculator/pom.xml Tue Apr  7 20:31:59 2009
@@ -37,6 +37,20 @@
             <type>pom</type>
         </dependency>
 
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-launcher-equinox</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-impl-osgi</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.eclipse.osgi</groupId>
             <artifactId>services</artifactId>

Modified: tuscany/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java?rev=762942&r1=762941&r2=762942&view=diff
==============================================================================
--- tuscany/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java (original)
+++ tuscany/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java Tue Apr  7 20:31:59 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package calculator.dosgi.impl;
 
@@ -69,12 +69,14 @@
                 }
             }
         }
-        for (Object s : localServices.getServices()) {
-            if (cls.isInstance(s)) {
-                System.out.println("Local service: " + s);
-                return cls.cast(s);
+        Object[] localObjects = localServices.getServices();
+        if (localObjects != null)
+            for (Object s : localObjects) {
+                if (cls.isInstance(s)) {
+                    System.out.println("Local service: " + s);
+                    return cls.cast(s);
+                }
             }
-        }
         throw new IllegalStateException(cls.getSimpleName() + " is not available");
     }
 

Modified: tuscany/java/sca/samples/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/pom.xml?rev=762942&r1=762941&r2=762942&view=diff
==============================================================================
--- tuscany/java/sca/samples/pom.xml (original)
+++ tuscany/java/sca/samples/pom.xml Tue Apr  7 20:31:59 2009
@@ -50,6 +50,9 @@
                 <module>calculator-rmi-reference</module>
                 <module>calculator-rmi-service</module>
 
+                <module>dosgi-calculator</module>
+                <module>dosgi-calculator-operations</module>
+
                 <module>implementation-java-calculator</module>
                 <module>binding-ws-calculator</module>
                 <!-- module>host-webapp-calculator</module -->