X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Forg.argeo.slc.lib.detached%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Flib%2Fdetached%2FDetachedLauncher.java;h=7422be38898fa6e49d843bbcc8022834ecf41102;hb=2fe9bd0b18209b3e5b51fb6e7df6edd0fade4842;hp=d9ff2f6be118c7f2fbd84e01fae688f1fb2d1ad5;hpb=d2f1498d82864a131a6e2e589c115d04af32b4f6;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java b/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java index d9ff2f6be..7422be388 100644 --- a/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java +++ b/runtime/org.argeo.slc.lib.detached/src/main/java/org/argeo/slc/lib/detached/DetachedLauncher.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * Licensed 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.argeo.slc.lib.detached; import java.io.File; @@ -26,7 +42,7 @@ public class DetachedLauncher extends JvmProcess implements BundleContextAware, private ResourceLoader resourceLoader = null; private Resource osgiFramework = null; - private String osgibootBundleName = "org.argeo.slc.osgiboot"; + private String osgibootBundleName = "org.argeo.osgi.boot"; private String equinoxBundleName = "org.eclipse.osgi"; private String xmlapisBundleName = "com.springsource.org.apache.xmlcommons"; private String xercesBundleName = "com.springsource.org.apache.xerces"; @@ -43,7 +59,7 @@ public class DetachedLauncher extends JvmProcess implements BundleContextAware, public DetachedLauncher() { // Override defaults setSynchronous(false); - setMainClass("org.argeo.slc.osgiboot.Launcher"); + setMainClass("org.argeo.osgi.boot.Launcher"); } public void afterPropertiesSet() throws Exception { @@ -62,11 +78,17 @@ public class DetachedLauncher extends JvmProcess implements BundleContextAware, bundles: for (Bundle bundle : bundleContext.getBundles()) { String name = bundle.getSymbolicName(); - if (excludeBundleNames.contains(name)) + if (excludeBundleNames.contains(name)) { + if (log.isDebugEnabled()) + log.debug("Exclude bundle " + name); continue bundles;// skip excluded + } - String location = bundle.getLocation(); - location = removeInitialReference(location); + String originalLocation = bundle.getLocation(); + if (log.isTraceEnabled()) + log.trace("Original location of bundle " + name + ": " + + originalLocation); + String location = removeInitialReference(originalLocation); // Special bundles if (osgibootBundleName.equals(name)) @@ -82,12 +104,19 @@ public class DetachedLauncher extends JvmProcess implements BundleContextAware, File file = new File(location.substring("file:".length())); if (osgiLocations.length() != 0) osgiLocations.append(File.pathSeparatorChar); - osgiLocations.append(file.getPath().replace('/', - File.separatorChar)); + location = file.getPath().replace('/', File.separatorChar); + osgiLocations.append(location); + if (log.isTraceEnabled()) + log.trace("Added bundle " + name + + " to argeo.osgi.locations: " + location); } else { if (osgiBundles.length() != 0) osgiBundles.append(','); - osgiBundles.append(location.replace('/', File.separatorChar)); + location = location.replace('/', File.separatorChar); + osgiBundles.append(location); + if (log.isTraceEnabled()) + log.trace("Added bundle " + name + " to osgi.bundles: " + + location); } } @@ -95,12 +124,16 @@ public class DetachedLauncher extends JvmProcess implements BundleContextAware, if (osgiBundles.length() != 0) osgiBundles.append(','); osgiBundles.append(url); + if (log.isDebugEnabled()) + log.debug("Include url" + url); } getSystemProperties().setProperty("osgi.bundles", osgiBundles.toString()); - getSystemProperties().setProperty("slc.osgi.locations", + getSystemProperties().setProperty("argeo.osgi.locations", osgiLocations.toString()); + + super.afterPropertiesSet(); } protected String removeInitialReference(String location) {