diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-15 06:50:04 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-15 06:50:04 +0000 |
commit | 147ed48e86bb4a13e42df35f1d1d800a7b564f4b (patch) | |
tree | 2412db1dcc7b46a214d2b7b46d21349ac08aa9b8 /branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java | |
parent | 512771c8a42d2cde253f6df55ef552f7a0b4f792 (diff) |
Removed more modules as in Oscar's TUSCANY-2440 reduced-set patch. Also removed newer modules added since r643746 and are not required to run the minimum set that we are porting to android. Set svn ignore properties to ignore Manifest files produced by the build.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@695356 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java')
-rw-r--r-- | branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java b/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java deleted file mode 100644 index 3f88bd89e9..0000000000 --- a/branches/sca-android/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxLauncherBundleHelper.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.apache.tuscany.sca.node.equinox.launcher; - -import static java.lang.System.currentTimeMillis; -import static java.lang.System.getProperty; -import static java.lang.System.setProperty; -import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.libraryBundle; -import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.string; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.BundleEvent; -import org.osgi.framework.BundleListener; - -/** - * Bundle activator which installs Tuscany modules into an OSGi runtime. - * - */ -public class EquinoxLauncherBundleHelper implements BundleListener { - private static Logger logger = Logger.getLogger(EquinoxLauncherBundleHelper.class.getName()); - - private List<Bundle> installedBundles = new ArrayList<Bundle>(); - private BundleContext bundleContext; - - public EquinoxLauncherBundleHelper() { - super(); - } - - public void start(BundleContext bundleContext) throws Exception { - this.bundleContext = bundleContext; - this.bundleContext.addBundleListener(this); - - // Install the Tuscany bundles - long start = currentTimeMillis(); - - // FIXME: SDO bundles dont have the correct dependencies - setProperty("commonj.sdo.impl.HelperProvider", "org.apache.tuscany.sdo.helper.HelperProviderImpl"); - - // Get the list of JAR files to install - String jarFilesProperty = getProperty("org.apache.tuscany.sca.node.launcher.equinox.jarFiles"); - String[] jarFiles = jarFilesProperty.split(";"); - - // Create a single 'library' bundle for them - long libraryStart = currentTimeMillis(); - InputStream library = libraryBundle(jarFiles); - logger.info("Third-party library bundle generated in " + (currentTimeMillis() - libraryStart) + " ms."); - libraryStart = currentTimeMillis(); - Bundle libraryBundle = bundleContext.installBundle("org.apache.tuscany.sca.node.launcher.equinox.libraries", library); - logger.info("Third-party library bundle installed in " + (currentTimeMillis() - libraryStart) + " ms: " + string(libraryBundle, false)); - installedBundles.add(libraryBundle); - - // Get the set of already installed bundles - Set<String> alreadyInstalledBundleNames = new HashSet<String>(); - for (Bundle bundle: bundleContext.getBundles()) { - alreadyInstalledBundleNames.add(bundle.getSymbolicName()); - } - - // Get the list of bundle files and names to install - String bundleFilesProperty = getProperty("org.apache.tuscany.sca.node.launcher.equinox.bundleFiles"); - String[] bundleFiles = bundleFilesProperty.split(";"); - String bundleNamesProperty = getProperty("org.apache.tuscany.sca.node.launcher.equinox.bundleNames"); - String[] bundleNames = bundleNamesProperty.split(";"); - - // Install all the bundles that are not already installed - for (int i =0, n = bundleFiles.length; i < n; i++) { - String bundleFile = bundleFiles[i]; - String bundleName = bundleNames[i]; - if (!alreadyInstalledBundleNames.contains(bundleName)) { - if (bundleName.contains("org.eclipse.jdt.junit")) { - continue; - } - long installStart = currentTimeMillis(); - Bundle bundle = bundleContext.installBundle(bundleFile); - logger.info("Bundle installed in " + (currentTimeMillis() - installStart) + " ms: " + string(bundle, false)); - installedBundles.add(bundle); - } - } - - long end = currentTimeMillis(); - logger.info("Tuscany bundles are installed in " + (end - start) + " ms."); - } - - public void stop(BundleContext bundleContext) throws Exception { - - // Uninstall all the bundles we've installed - for (int i = installedBundles.size() -1; i >= 0; i--) { - Bundle bundle = installedBundles.get(i); - try { - //if (logger.isLoggable(Level.FINE)) { - logger.info("Uninstalling bundle: " + string(bundle, false)); - //} - bundle.uninstall(); - } catch (Exception e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - } - installedBundles.clear(); - - this.bundleContext.removeBundleListener(this); - this.bundleContext = null; - } - - public void bundleChanged(BundleEvent event) { - } - -} |