diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-07 20:31:59 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-07 20:31:59 +0000 |
commit | 68e79e1901937b595bd7e507a2103754be844a76 (patch) | |
tree | 0f4cecf224c342ffde3b2d42e90163050c5fe033 | |
parent | d5221777347a39a10f7c31c2590a4088d5c28f0b (diff) |
Fix the dependencies to get distributed OSGi samples working inside Eclipse
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@762942 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/features/ejava/pom.xml | 6 | ||||
-rw-r--r-- | java/sca/pom.xml | 2 | ||||
-rw-r--r-- | java/sca/samples/dosgi-calculator-operations/pom.xml | 14 | ||||
-rw-r--r-- | java/sca/samples/dosgi-calculator/pom.xml | 14 | ||||
-rw-r--r-- | java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java | 18 | ||||
-rw-r--r-- | java/sca/samples/pom.xml | 3 |
6 files changed, 48 insertions, 9 deletions
diff --git a/java/sca/features/ejava/pom.xml b/java/sca/features/ejava/pom.xml index 7e858478e1..c11c1cc503 100644 --- a/java/sca/features/ejava/pom.xml +++ b/java/sca/features/ejava/pom.xml @@ -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 -->
<!--
diff --git a/java/sca/pom.xml b/java/sca/pom.xml index 51accc8610..365a7606f5 100644 --- a/java/sca/pom.xml +++ b/java/sca/pom.xml @@ -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> diff --git a/java/sca/samples/dosgi-calculator-operations/pom.xml b/java/sca/samples/dosgi-calculator-operations/pom.xml index 0c19839be3..945b9bbb6d 100644 --- a/java/sca/samples/dosgi-calculator-operations/pom.xml +++ b/java/sca/samples/dosgi-calculator-operations/pom.xml @@ -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>
diff --git a/java/sca/samples/dosgi-calculator/pom.xml b/java/sca/samples/dosgi-calculator/pom.xml index 678b29f772..4f2b390588 100644 --- a/java/sca/samples/dosgi-calculator/pom.xml +++ b/java/sca/samples/dosgi-calculator/pom.xml @@ -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>
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java index 8a9fea47c0..046e8cf565 100644 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java +++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java @@ -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 @@ public class CalculatorServiceImpl implements CalculatorService { }
}
}
- 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");
}
diff --git a/java/sca/samples/pom.xml b/java/sca/samples/pom.xml index 6eee77937c..e4bc31ee15 100644 --- a/java/sca/samples/pom.xml +++ b/java/sca/samples/pom.xml @@ -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 --> |