Added:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/FelixRuntime.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/FelixRuntime.java?rev=575799&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/FelixRuntime.java
(added)
+++
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/FelixRuntime.java
Fri Sep 14 14:40:35 2007
@@ -0,0 +1,193 @@
+/*
+ * 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 org.apache.tuscany.sca.osgi.runtime;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class FelixRuntime extends OSGiRuntime implements BundleActivator {
+
+ private static BundleContext bundleContext;
+
+ private static FelixRuntime instance;
+
+ private static Class felixClass;
+ private static Object felix;
+
+ public static OSGiRuntime getInstance() throws Exception {
+ if (instance == null) {
+ FelixRuntime runtime = new FelixRuntime();
+ runtime.startRuntime();
+ instance = runtime;
+ }
+ return instance;
+ }
+
+
+ private static void deleteDirectory(File dir) {
+
+ File[] files = dir.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ if (files[i].isDirectory())
+ deleteDirectory(files[i]);
+ else
+ files[i].delete();
+ }
+ dir.delete();
+
+ }
+
+ private BundleContext startRuntime() throws Exception {
+
+ if (bundleContext != null)
+ return bundleContext;
+
+
+ ClassLoader cl = FelixRuntime.class.getClassLoader();
+
+ Class felixMainClass = cl.loadClass("org.apache.felix.main.Main");
+ felixClass = cl.loadClass("org.apache.felix.framework.Felix");
+ Method propsMethod = felixMainClass.getMethod("loadConfigProperties");
+ Properties props = (Properties)propsMethod.invoke(null);
+
+ File profileDir = new File(".felix");
+ if (profileDir.isDirectory())
+ deleteDirectory(profileDir);
+ else
+ profileDir.delete();
+ profileDir.mkdir();
+ profileDir.deleteOnExit();
+
+ props.put("felix.cache.profiledir", profileDir.getAbsolutePath());
+ props.put("felix.embedded.execution", "true");
+ props.put("org.osgi.framework.system.packages",
+ "org.osgi.framework; version=1.3.0," +
+ "org.osgi.service.packageadmin; version=1.2.0, " +
+ "org.osgi.service.startlevel; version=1.0.0, " +
+ "org.osgi.service.url; version=1.0.0, " +
+ "org.osoa.sca.annotations; version=1.0.0, " +
+ "org.osoa.sca; version=1.0.0");
+
+
+ try {
+ Constructor felixConstructor =
felixClass.getConstructor(Map.class, List.class);
+ List<BundleActivator> activators = new
ArrayList<BundleActivator>();
+ felix = felixConstructor.newInstance(props, activators);
+ ((Bundle)felix).start();
+ bundleContext = ((Bundle)felix).getBundleContext();
+
+
+ } catch (Exception e) {
+
+ // This is the older Felix API which has been retained temporarily
to avoid build break
+ // TODO: Remove these once Felix 1.0.0 is released.
+
+ Class propertyResolverClass =
cl.loadClass("org.apache.felix.framework.util.MutablePropertyResolver");
+ Class propertyResolverImplClass =
cl.loadClass("org.apache.felix.framework.util.MutablePropertyResolverImpl");
+
+ Constructor implConstructor =
propertyResolverImplClass.getConstructor(Map.class);
+ Object mutableProps = implConstructor.newInstance(props);
+
+
+ try {
+ Constructor felixConstructor =
felixClass.getConstructor(propertyResolverClass, List.class);
+ List<BundleActivator> activators = new
ArrayList<BundleActivator>();
+ felix = felixConstructor.newInstance(mutableProps, activators);
+ ((Bundle)felix).start();
+ bundleContext = ((Bundle)felix).getBundleContext();
+ } catch (Exception e1) {
+
+
+ felix = felixClass.newInstance();
+ Method startMethod = felixClass.getMethod("start",
propertyResolverClass, List.class);
+ List<BundleActivator> activators = new
ArrayList<BundleActivator>();
+ BundleActivator activator = new FelixRuntime();
+ activators.add(activator);
+ startMethod.invoke(felix, mutableProps, activators);
+
+ synchronized (activator) {
+ int retries = 0;
+ while (bundleContext == null && retries++ < 10) {
+ activator.wait(1000);
+ }
+ }
+ }
+ }
+
+ return bundleContext;
+
+ }
+
+ public void start(BundleContext context) throws Exception {
+
+ bundleContext = context;
+ synchronized (this) {
+ this.notify();
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ bundleContext = null;
+ }
+
+
+
+ @Override
+ public BundleContext getBundleContext() {
+ return bundleContext;
+ }
+
+
+ @Override
+ public void shutdown() throws Exception {
+
+ if (bundleContext == null)
+ return;
+ bundleContext = null;
+ instance = null;
+
+ if (felix instanceof Bundle) {
+ ((Bundle)felix).stop();
+ }
+ else if (felix != null) {
+ Method shutdownMethod = felixClass.getMethod("shutdown");
+ try {
+ shutdownMethod.invoke(felix);
+ } catch (Exception e) {
+ // Ignore errors
+ }
+ felix = null;
+ }
+ }
+
+ @Override
+ public boolean supportsBundleFragments() {
+ return false;
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/FelixRuntime.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/FelixRuntime.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/KnopflerfishRuntime.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/KnopflerfishRuntime.java?rev=575799&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/KnopflerfishRuntime.java
(added)
+++
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/KnopflerfishRuntime.java
Fri Sep 14 14:40:35 2007
@@ -0,0 +1,156 @@
+/*
+ * 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 org.apache.tuscany.sca.osgi.runtime;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.Hashtable;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+public class KnopflerfishRuntime extends OSGiRuntime {
+
+ private static BundleContext bundleContext;
+
+ private static KnopflerfishRuntime instance;
+
+
+ private static Class frameworkClass;
+
+ private static Object framework;
+
+ public static OSGiRuntime getInstance() throws Exception {
+ if (instance == null) {
+ KnopflerfishRuntime runtime = new KnopflerfishRuntime();
+ runtime.startRuntime();
+ instance = runtime;
+ }
+ return instance;
+ }
+
+
+
+ // FIXME: Knopflerfish does not expose the methods used for configuration
as public methods
+ // It may be worth using the private methods in
org.knopflerfish.framework.Main for
+ // configuring using reflection if security policies allow it.
+ // For now, a simple configuration routine reads sca.xargs from the
directory in
+ // the classpath which contains framework.jar. The entries in
init.xargs starting with
+ // -install are assumed to be single-line entries with full bundle
location.
+ //
+ private BundleContext startRuntime() throws Exception {
+
+ if (bundleContext != null)
+ return bundleContext;
+
+
+
+ System.setProperty("org.knopflerfish.framework.bundlestorage",
"memory");
+
+ frameworkClass =
KnopflerfishRuntime.class.getClassLoader().loadClass("org.knopflerfish.framework.Framework");
+ Constructor frameworkConstructor =
frameworkClass.getConstructor(Object.class);
+ framework = frameworkConstructor.newInstance(new
KnopflerfishRuntime());
+ Method launchMethod = frameworkClass.getMethod("launch", long.class);
+ launchMethod.invoke(framework, 0);
+ Method getContextMethod =
frameworkClass.getMethod("getSystemBundleContext");
+ bundleContext = (BundleContext)getContextMethod.invoke(framework);
+
+ System.setProperty("com.gatespace.bundle.cm.store",
"knopflerfish.store");
+ File xargsFile = null;
+ String classpath = System.getProperty("java.class.path");
+ String[] classpathEntries =
classpath.split(System.getProperty("path.separator"));
+ for (int i = 0; i < classpathEntries.length; i++) {
+ if (classpathEntries[i].endsWith("framework.jar")) {
+ String path = classpathEntries[i].substring(0,
classpathEntries[i].length() - "framework.jar".length());
+ path = path + "sca.xargs";
+ xargsFile = new File(path);
+ if (!xargsFile.exists())
+ xargsFile = null;
+ break;
+ }
+ }
+ if (xargsFile != null) {
+ BufferedReader reader = new BufferedReader(new
FileReader(xargsFile));
+ String line;
+ Hashtable<String, Bundle> bundles = new Hashtable<String,
Bundle>();
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.startsWith("-install")) {
+ try {
+
+ String bundleLocation =
line.substring("-install".length()).trim();
+ Bundle bundle =
bundleContext.installBundle(bundleLocation);
+ bundles.put(bundleLocation, bundle);
+
+ } catch (BundleException e) {
+ e.printStackTrace();
+ }
+
+ }
+ if (line.startsWith("-start")) {
+
+ try {
+ String bundleLocation =
line.substring("-start".length()).trim();
+ Bundle bundle = bundles.get(bundleLocation);
+ bundle.start();
+ } catch (BundleException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+
+ return bundleContext;
+
+ }
+
+ @Override
+ public BundleContext getBundleContext() {
+ return bundleContext;
+ }
+
+ @Override
+ public void shutdown() throws Exception {
+
+ if (bundleContext == null)
+ return;
+ bundleContext = null;
+ instance = null;
+ if (framework != null) {
+ Method shutdownMethod = frameworkClass.getMethod("shutdown");
+ try {
+ shutdownMethod.invoke(framework);
+ } catch (Exception e) {
+ // Ignore errors
+ }
+ framework = null;
+ }
+
+ }
+
+ @Override
+ public boolean supportsBundleFragments() {
+ return true;
+ }
+}
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/KnopflerfishRuntime.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/KnopflerfishRuntime.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntime.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntime.java?rev=575799&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntime.java
(added)
+++
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntime.java
Fri Sep 14 14:40:35 2007
@@ -0,0 +1,170 @@
+/*
+ * 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 org.apache.tuscany.sca.osgi.runtime;
+
+
+import java.io.InputStream;
+import java.lang.reflect.Method;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+public abstract class OSGiRuntime {
+
+ private BundleContext bundleContext;
+
+ public abstract BundleContext getBundleContext();
+
+ public abstract void shutdown() throws Exception;
+
+ public abstract boolean supportsBundleFragments();
+
+ private PackageAdmin packageAdmin;
+
+
+ /**
+ * System property
org.apache.tuscany.implementation.osgi.runtime.OSGiRuntime can be set to the
+ * name of the OSGiRuntime class (eg. EquinoxRuntime). If set, start this
runtime and return the
+ * system bundlecontext. If not set, start Equinox/Felix/Knopflerfish (in
that order) from the
+ * classpath.
+ *
+ * @throws BundleException
+ */
+ public static OSGiRuntime getRuntime() throws Exception {
+
+ String runtimeClassName =
System.getProperty(OSGiRuntime.class.getName());
+
+ if (runtimeClassName != null) {
+ try {
+ Class<?> runtimeClass =
OSGiRuntime.class.getClassLoader().loadClass(runtimeClassName);
+ Method method = runtimeClass.getMethod("getInstance");
+ return (OSGiRuntime) method.invoke(null);
+
+ } catch (Exception e) {
+ throw new BundleException("Could not start OSGi runtime " +
runtimeClassName, e);
+ }
+ }
+
+ try {
+
+ return EquinoxRuntime.getInstance();
+
+ } catch (ClassNotFoundException e) {
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+
+ try {
+
+ return FelixRuntime.getInstance();
+
+ } catch (ClassNotFoundException e) {
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+
+ try {
+
+ return KnopflerfishRuntime.getInstance();
+
+ } catch (ClassNotFoundException e) {
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+
+ throw new BundleException("Could not start OSGi runtime from the
classpath");
+ }
+
+ private void initialize() {
+ if (bundleContext == null)
+ bundleContext = getBundleContext();
+
+ if (bundleContext != null) {
+
+ org.osgi.framework.ServiceReference packageAdminReference =
+
bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
+ if (packageAdminReference != null) {
+
+ packageAdmin = (PackageAdmin)
bundleContext.getService(packageAdminReference);
+ }
+ }
+
+ }
+
+
+ public Bundle findBundle(String bundleSymbolicName, String bundleVersion) {
+
+ initialize();
+
+ if (bundleContext != null) {
+ Bundle[] installedBundles = bundleContext.getBundles();
+ for (Bundle bundle : installedBundles) {
+ if (bundleSymbolicName.equals(bundle.getSymbolicName()) &&
+ (bundleVersion == null ||
+
bundleVersion.equals(bundle.getHeaders().get("Bundle-Version"))))
+ return bundle;
+ }
+
+ }
+ return null;
+ }
+
+
+ public Bundle findBundle(String bundleLocation) {
+
+ initialize();
+
+ if (bundleContext != null) {
+ Bundle[] installedBundles = bundleContext.getBundles();
+ for (Bundle bundle : installedBundles) {
+ if (bundle.getLocation().equals(bundleLocation))
+ return bundle;
+ }
+
+ }
+ return null;
+ }
+
+ public Bundle installBundle(String bundleLocation, InputStream
inputStream) {
+
+ initialize();
+
+ try {
+ if (bundleContext != null) {
+ Bundle bundle = findBundle(bundleLocation);
+ if (bundle != null)
+ return bundle;
+ if (inputStream == null)
+ bundle = bundleContext.installBundle(bundleLocation);
+ else
+ bundle = bundleContext.installBundle(bundleLocation,
inputStream);
+
+ if (bundle != null && packageAdmin != null)
+ packageAdmin.refreshPackages(null);
+
+ return bundle;
+ }
+ } catch (BundleException e) {
+ }
+ return null;
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntime.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/main/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntime.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/modules/osgi-runtime/src/test/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntimeTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/osgi-runtime/src/test/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntimeTestCase.java?rev=575799&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/osgi-runtime/src/test/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntimeTestCase.java
(added)
+++
incubator/tuscany/java/sca/modules/osgi-runtime/src/test/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntimeTestCase.java
Fri Sep 14 14:40:35 2007
@@ -0,0 +1,58 @@
+/*
+ * 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 org.apache.tuscany.sca.osgi.runtime;
+
+import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
+import org.osgi.framework.BundleContext;
+
+import junit.framework.TestCase;
+
+/**
+ * Test OSGi runtime.
+ *
+ */
+public class OSGiRuntimeTestCase extends TestCase {
+
+ public void testRuntime() throws Exception {
+
+ BundleContext bc1 = OSGiRuntime.getRuntime().getBundleContext();
+
+ assertNotNull(bc1);
+
+ BundleContext bc2 = OSGiRuntime.getRuntime().getBundleContext();
+
+ assertNotNull(bc2);
+
+ assertTrue(bc1 == bc2);
+
+ OSGiRuntime.getRuntime().shutdown();
+
+ BundleContext bc3 = OSGiRuntime.getRuntime().getBundleContext();
+
+ assertNotNull(bc3);
+
+ assertTrue(bc1 != bc3);
+
+
+
+ }
+
+
+}
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/test/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntimeTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/osgi-runtime/src/test/java/org/apache/tuscany/sca/osgi/runtime/OSGiRuntimeTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/modules/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/pom.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/pom.xml Fri Sep 14 14:40:35 2007
@@ -50,6 +50,7 @@
<module>binding-rmi</module>
<module>binding-sca</module>
<module>binding-sca-axis2</module>
+ <module>binding-osgi</module>
<!--
<module>binding-sca-jms</module>
-->
@@ -61,6 +62,7 @@
<module>contribution-impl</module>
<module>contribution-namespace</module>
<module>contribution-java</module>
+ <module>contribution-osgi</module>
<module>core</module>
<module>core-databinding</module>
<module>core-spi</module>
@@ -107,6 +109,8 @@
<module>implementation-node-runtime</module>
<module>implementation-notification</module>
<module>implementation-osgi</module>
+ <module>osgi-runtime</module>
+
<module>implementation-resource</module>
<module>implementation-script</module>
<module>implementation-spring</module>
Modified: incubator/tuscany/java/sca/samples/osgi-supplychain/README
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/README?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/osgi-supplychain/README (original)
+++ incubator/tuscany/java/sca/samples/osgi-supplychain/README Fri Sep 14
14:40:35 2007
@@ -30,7 +30,11 @@
The SupplyChainClient exercises this interface by calling the
purchaseGoods operation. This results in messages passing to
the Retailer, Warehouse, and Shipper components and the result returned
-to the Customer service on a separate callback thread.
+to the Customer service on a separate callback thread. The Customer
+and Shipper components are implemented as OSGi bundles which use
+implementation.osgi, while the Retailer and Warehouse components are
+implemented using implementation.java.
+
src
+---main
@@ -121,17 +125,10 @@
run:
[java] Main thread Thread[main,5,main]
- [java] Created OSGiCustomerImpl
- [java] Started bundle OSGiCustomerImpl
- [java] Customer.purchaseGoods, retailer is [Proxy - 1afae45]
- [java] Retailer.submitOrder, warehouse is [Proxy - 811c88]
- [java] Warehouse.fulfillOrder : shipper is [Proxy - 15bdc50]
- [java] Created OSGiShipperImpl
- [java] Started bundle OSGiShipperImpl
- [java] Shipper.processShipment, customer is [Proxy - 60e128]
- [java] Main thread sleeping ...
- [java] Work thread Thread[pool-1-thread-1,5,main] - Order, submitted,
fulfi
-lled, shipped
+ [java] Main thread Started OSGi bundle with activator OSGiCustomerImpl
+ [java] Main thread Started OSGi bundle with activator OSGiShipperImpl
+ [java] Main thread Sleeping ...
+ [java] Work thread Thread[pool-1-thread-1,5,main] - Order, submitted,
fulfilled, shipped
@@ -151,6 +148,8 @@
-------------------------------------------------------
Running supplychain.SupplyChainClientTestCase
Main thread Thread[main,5,main]
+Started OSGi bundle with activator OSGiCustomerImpl
+Started OSGi bundle with activator OSGiShipperImpl
Sleeping ...
Work thread Thread[pool-1-thread-1,5,main] - Order, submitted, fulfilled,
shipped
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.625 sec
Modified: incubator/tuscany/java/sca/samples/osgi-supplychain/build.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/build.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/osgi-supplychain/build.xml (original)
+++ incubator/tuscany/java/sca/samples/osgi-supplychain/build.xml Fri Sep 14
14:40:35 2007
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
-->
-<project name="osgi-supplychain" default="compile">
+<project name="sample-osgi-supplychain" default="compile">
<property name="test.class" value="supplychain.SupplyChainClient" />
- <property name="test.jar" value="sample-osgi-supplychain.jar" />
-
+ <property name="test.jar" value="sample-osgi-supplychain.jar" />
+
<target name="init">
<mkdir dir="target/classes"/>
</target>
-
+
<target name="compile" depends="init">
<javac srcdir="src/main/java"
destdir="target/classes"
@@ -31,7 +31,7 @@
source="1.5"
target="1.5">
<classpath>
- <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
</classpath>
</javac>
<copy todir="target/classes">
@@ -41,29 +41,57 @@
<manifest>
<attribute name="Main-Class" value="${test.class}" />
</manifest>
- </jar>
- </target>
-
+ </jar>
+ <jar jarfile="target/classes/Customer.jar"
manifest="target/classes/osgi/Customer.mf" >
+ <fileset dir="target/classes"
+ includes="supplychain/customer/Customer.class \
+ supplychain/OSGiBundleImpl.class \
+ supplychain/customer/OSGiCustomerImpl.class"
+ />
+ </jar>
+ <jar jarfile="target/classes/Retailer.jar"
manifest="target/classes/osgi/Retailer.mf" >
+ <fileset dir="target/classes"
+ includes="supplychain/retailer/Retailer.class \
+ supplychain/OSGiBundleImpl.class \
+ supplychain/retailer/OSGiRetailerImpl.class"
+ />
+ </jar>
+ <jar jarfile="target/classes/Warehouse.jar"
manifest="target/classes/osgi/Warehouse.mf" >
+ <fileset dir="target/classes"
+ includes="supplychain/warehouse/Warehouse.class \
+ supplychain/OSGiBundleImpl.class \
+ supplychain/warehouse/OSGiWarehouseImpl.class"
+ />
+ </jar>
+ <jar jarfile="target/classes/Shipper.jar"
manifest="target/classes/osgi/Shipper.mf" >
+ <fileset dir="target/classes"
+ includes="supplychain/shipper/Shipper.class \
+ supplychain/OSGiBundleImpl.class \
+ supplychain/shipper/OSGiShipperImpl.class"
+ />
+ </jar>
+ </target>
+
<target name="run-classes">
<java classname="${test.class}"
fork="true">
<classpath>
<pathelement path="target/classes"/>
- <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
+
<target name="run">
<java classname="${test.class}"
fork="true">
<classpath>
<pathelement path="target/${test.jar}"/>
- <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
</classpath>
- </java>
- </target>
-
+ </java>
+ </target>
+
<target name="clean">
<delete quiet="true" includeemptydirs="true">
<fileset dir="target"/>
Modified: incubator/tuscany/java/sca/samples/osgi-supplychain/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/pom.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/osgi-supplychain/pom.xml (original)
+++ incubator/tuscany/java/sca/samples/osgi-supplychain/pom.xml Fri Sep 14
14:40:35 2007
@@ -90,7 +90,7 @@
<configuration>
<tasks>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="Customer.jar" />
<property name="manifest.file.name"
value="osgi/Customer.mf" />
@@ -101,7 +101,7 @@
</ant>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="Retailer.jar" />
<property name="manifest.file.name"
value="osgi/Retailer.mf" />
@@ -112,7 +112,7 @@
</ant>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="Shipper.jar" />
<property name="manifest.file.name"
value="osgi/Shipper.mf" />
@@ -123,7 +123,7 @@
</ant>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="Warehouse.jar" />
<property name="manifest.file.name"
value="osgi/Warehouse.mf" />
@@ -134,7 +134,7 @@
</ant>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="DSCustomer.jar" />
<property name="manifest.file.name"
value="osgi/ds/Customer.mf" />
@@ -145,7 +145,7 @@
</ant>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="DSRetailer.jar" />
<property name="manifest.file.name"
value="osgi/ds/Retailer.mf" />
@@ -156,7 +156,7 @@
</ant>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="DSShipper.jar" />
<property name="manifest.file.name"
value="osgi/ds/Shipper.mf" />
@@ -167,7 +167,7 @@
</ant>
<ant antfile="./build-bundles.xml"
target="create-bundles">
- <property name="jar.dir" value="target" />
+ <property name="jar.dir"
value="target/classes" />
<property name="files.dir"
value="target/classes" />
<property name="jar.file.name"
value="DSWarehouse.jar" />
<property name="manifest.file.name"
value="osgi/ds/Warehouse.mf" />
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/OSGiBundleImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/OSGiBundleImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/OSGiBundleImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/OSGiBundleImpl.java
Fri Sep 14 14:40:35 2007
@@ -48,8 +48,6 @@
public OSGiBundleImpl(String serviceName, String... references) {
- System.out.println("Created " + this.getClass().getSimpleName());
-
myClass = this.getClass();
this.name = this.getClass().getSimpleName();
this.serviceName = serviceName;
@@ -72,7 +70,7 @@
public void start(BundleContext bc) {
- System.out.println("Started bundle " + name);
+ System.out.println("Started OSGi bundle with activator " + name);
this.bundleContext = bc;
@@ -97,7 +95,7 @@
}
public void stop(BundleContext bc) {
- System.out.println("Stop bundle " + name);
+ System.out.println("Stop OSGi bundle with activator " + name);
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -39,7 +39,6 @@
}
public void purchaseGoods() {
- System.out.println("Customer.purchaseGoods, retailer is " + retailer);
retailer.submitOrder("Order");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -39,7 +39,6 @@
}
public void purchaseGoods() {
- System.out.println("Customer.purchaseGoods, retailer is " + retailer);
retailer.submitOrder("Order");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/customer/OSGiCustomerImpl.java
Fri Sep 14 14:40:35 2007
@@ -35,7 +35,6 @@
}
public void purchaseGoods() {
- System.out.println("Customer.purchaseGoods, retailer is " + retailer);
retailer.submitOrder("Order");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -43,7 +43,6 @@
public void submitOrder(String order) {
- System.out.println("Retailer.submitOrder, warehouse is " + warehouse);
warehouse.fulfillOrder(order + ", submitted");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -38,7 +38,6 @@
public void submitOrder(String order) {
- System.out.println("Retailer.submitOrder, warehouse is" + warehouse);
warehouse.fulfillOrder(order + ", submitted");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/retailer/OSGiRetailerImpl.java
Fri Sep 14 14:40:35 2007
@@ -35,8 +35,6 @@
}
public void submitOrder(String order) {
-
- System.out.println("Retailer.submitOrder, warehouse is " + warehouse);
warehouse.fulfillOrder(order + ", submitted");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -40,7 +40,6 @@
}
public void processShipment(String order) {
- System.out.println("Shipper.processShipment, customer is " + customer);
customer.notifyShipment(order + ", shipped");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -38,7 +38,6 @@
}
public void processShipment(String order) {
- System.out.println("Shipper.processShipment, customer is " + customer);
customer.notifyShipment(order + ", shipped");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/shipper/OSGiShipperImpl.java
Fri Sep 14 14:40:35 2007
@@ -35,7 +35,6 @@
public void processShipment(String order) {
- System.out.println("Shipper.processShipment, customer is " + customer);
customer.notifyShipment(order + ", shipped");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -40,8 +40,6 @@
}
public void fulfillOrder(String order) {
- System.out.println("Warehouse.fulfillOrder : shipper is " + shipper);
-
shipper.processShipment(order + ", fulfilled");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java
Fri Sep 14 14:40:35 2007
@@ -38,8 +38,6 @@
}
public void fulfillOrder(String order) {
- System.out.println("Warehouse.fulfillOrder : shipper is " + shipper);
-
shipper.processShipment(order + ", fulfilled");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java
Fri Sep 14 14:40:35 2007
@@ -36,8 +36,6 @@
public void fulfillOrder(String order) {
- System.out.println("Warehouse.fulfillOrder : shipper is " + shipper);
-
shipper.processShipment(order + ", fulfilled");
}
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Customer.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Customer.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Customer.xml
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Customer.xml
Fri Sep 14 14:40:35 2007
@@ -27,7 +27,6 @@
interface="supplychain.retailer.Retailer"
bind="setRetailer"
unbind="unsetRetailer"
- target="(component.name=RetailerComponent)"
policy="dynamic"
/>
</component>
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Retailer.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Retailer.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Retailer.xml
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Retailer.xml
Fri Sep 14 14:40:35 2007
@@ -27,7 +27,6 @@
interface="supplychain.warehouse.Warehouse"
bind="setWarehouse"
unbind="unsetWarehouse"
- target="(component.name=WarehouseComponent)"
policy="dynamic"
/>
</component>
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Shipper.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Shipper.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Shipper.xml
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Shipper.xml
Fri Sep 14 14:40:35 2007
@@ -27,7 +27,6 @@
interface="supplychain.customer.Customer"
bind="setCustomer"
unbind="unsetCustomer"
- target="(component.name=CustomerComponent)"
cardinality="0..1"
policy="dynamic"
/>
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Warehouse.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Warehouse.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Warehouse.xml
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/osgi/ds/Warehouse.xml
Fri Sep 14 14:40:35 2007
@@ -27,7 +27,6 @@
interface="supplychain.shipper.Shipper"
bind="setShipper"
unbind="unsetShipper"
- target="(component.name=ShipperComponent)"
policy="dynamic"
/>
</component>
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.composite?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.composite
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.composite
Fri Sep 14 14:40:35 2007
@@ -27,8 +27,7 @@
<component name="CustomerComponent">
<tuscany:implementation.osgi
bundle="Customer"
- bundleLocation="file:target/Customer.jar"
- scope="COMPOSITE"
+ bundleSymbolicName="supplychain.customer.Customer"
/>
<!--implementation.java
class="supplychain.customer.JavaCustomerComponentImpl" -->
@@ -39,7 +38,7 @@
<implementation.java
class="supplychain.retailer.JavaRetailerComponentImpl" />
<!--implementation.osgi
bundle="Retailer"
- bundleLocation="file:target/Retailer.jar"
+ bundleSymbolicName="supplychain.retailer.Retailer"
/-->
<reference name="warehouse" target="WarehouseComponent"/>
</component>
@@ -48,15 +47,15 @@
<implementation.java
class="supplychain.warehouse.JavaWarehouseComponentImpl" />
<!--implementation.osgi
bundle="Warehouse"
- bundleLocation="file:target/Warehouse.jar"
+ bundleSymbolicName="supplychain.warehouse.Warehouse"
/-->
<reference name="shipper" target="ShipperComponent" />
</component>
<component name="ShipperComponent">
<tuscany:implementation.osgi
- bundle="Shipper"
- bundleLocation="file:target/Shipper.jar"
+ bundle="Shipper"
+ bundleSymbolicName="supplychain.shipper.Shipper"
/>
<!--implementation.java
class="supplychain.shipper.JavaShipperComponentImpl" /-->
<reference name="customer" target="CustomerComponent" />
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.ds.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.ds.composite?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.ds.composite
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/main/resources/supplychain.ds.composite
Fri Sep 14 14:40:35 2007
@@ -27,8 +27,7 @@
<component name="CustomerComponent">
<tuscany:implementation.osgi
bundle="Customer"
- bundleLocation="file:target/DSCustomer.jar"
- scope="COMPOSITE"
+ bundleSymbolicName="ds.supplychain.customer.Customer"
/>
<!--implementation.java
class="supplychain.customer.JavaCustomerComponentImpl" -->
@@ -37,9 +36,9 @@
<component name="RetailerComponent">
<implementation.java
class="supplychain.retailer.JavaRetailerComponentImpl" />
- <!--implementation.osgi
+ <!--tuscany:implementation.osgi
bundle="Retailer"
- bundleLocation="file:target/DSRetailer.jar"
+ bundleSymbolicName="ds.supplychain.retailer.Retailer"
/-->
<reference name="warehouse" target="WarehouseComponent"/>
</component>
@@ -48,7 +47,7 @@
<implementation.java
class="supplychain.warehouse.JavaWarehouseComponentImpl" />
<!--implementation.osgi
bundle="Warehouse"
- bundleLocation="file:target/DSWarehouse.jar"
+ bundleSymbolicName="ds.supplychain.warehouse.Warehouse"
/-->
<reference name="shipper" target="ShipperComponent" />
</component>
@@ -56,7 +55,7 @@
<component name="ShipperComponent">
<tuscany:implementation.osgi
bundle="Shipper"
- bundleLocation="file:target/DSShipper.jar"
+ bundleSymbolicName="ds.supplychain.shipper.Shipper"
/>
<!--implementation.java
class="supplychain.shipper.JavaShipperComponentImpl" /-->
<reference name="customer" target="CustomerComponent" />
Modified:
incubator/tuscany/java/sca/samples/osgi-supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/osgi-supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
---
incubator/tuscany/java/sca/samples/osgi-supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
(original)
+++
incubator/tuscany/java/sca/samples/osgi-supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
Fri Sep 14 14:40:35 2007
@@ -47,10 +47,7 @@
public void test() throws Exception {
-
-
- System.out.println("In SupplyChainClientTestCase.test: Calling
customer.purchaseGoods, customer is " + customer);
-
+
customer.purchaseGoods();
System.out.println("Sleeping ...");
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]