From: Mathieu Baudier Date: Sun, 9 May 2010 08:08:09 +0000 (+0000) Subject: Introduce OSGi standard runtime X-Git-Tag: argeo-commons-2.1.30~1608 X-Git-Url: https://git.argeo.org/?a=commitdiff_plain;h=da5a4f5ea55536e34a4b7de6b391a1a9f91dad9d;p=lgpl%2Fargeo-commons.git Introduce OSGi standard runtime git-svn-id: https://svn.argeo.org/commons/trunk@3575 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/osgi/dep/org.argeo.osgi.dep.stdruntime/pom.xml b/osgi/dep/org.argeo.osgi.dep.stdruntime/pom.xml new file mode 100644 index 000000000..29d3ac7be --- /dev/null +++ b/osgi/dep/org.argeo.osgi.dep.stdruntime/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + + org.argeo.commons.osgi + 0.1.3-SNAPSHOT + dep + .. + + org.argeo.osgi.dep.stdruntime + pom + Dep OSGi Runtime + + + + org.argeo.commons.osgi + org.argeo.osgi.boot + ${project.version} + + + + org.argeo.commons.basic + org.argeo.basic.dep.log4j + ${project.version} + pom + + + + org.springframework.osgi + org.springframework.osgi.core + + + org.springframework.osgi + org.springframework.osgi.extender + + + \ No newline at end of file diff --git a/osgi/dep/pom.xml b/osgi/dep/pom.xml new file mode 100644 index 000000000..f56ec6ef1 --- /dev/null +++ b/osgi/dep/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + org.argeo.commons + 0.1.3-SNAPSHOT + osgi + .. + + org.argeo.commons.osgi + dep + Commons Server Dependencies + pom + + org.argeo.osgi.dep.stdruntime + + \ No newline at end of file diff --git a/osgi/pom.xml b/osgi/pom.xml index 282558762..302b41de5 100644 --- a/osgi/pom.xml +++ b/osgi/pom.xml @@ -12,5 +12,6 @@ pom runtime + dep \ No newline at end of file diff --git a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Activator.java b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Activator.java index 80ec7b7f2..8397a7636 100644 --- a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Activator.java +++ b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Activator.java @@ -13,17 +13,6 @@ public class Activator implements BundleActivator { public void start(BundleContext bundleContext) throws Exception { OsgiBoot osgiBoot = new OsgiBoot(bundleContext); osgiBoot.bootstrap(); -// try { -// OsgiBoot.info("SLC OSGi bootstrap starting..."); -// osgiBoot.installUrls(osgiBoot.getBundlesUrls()); -// osgiBoot.installUrls(osgiBoot.getLocationsUrls()); -// osgiBoot.installUrls(osgiBoot.getModulesUrls()); -// osgiBoot.startBundles(); -// OsgiBoot.info("SLC OSGi bootstrap completed"); -// } catch (Exception e) { -// e.printStackTrace(); -// throw e; -// } } public void stop(BundleContext context) throws Exception { diff --git a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/OsgiBoot.java b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/OsgiBoot.java index d54fa8899..17547f244 100644 --- a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/OsgiBoot.java +++ b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/OsgiBoot.java @@ -118,6 +118,7 @@ public class OsgiBoot { } public void bootstrap() { + long begin = System.currentTimeMillis(); System.out.println(); info("OSGi bootstrap starting..."); info("Writable data directory : " @@ -128,7 +129,10 @@ public class OsgiBoot { installUrls(getModulesUrls()); checkUnresolved(); startBundles(); - info("OSGi bootstrap completed"); + long duration = System.currentTimeMillis() - begin; + info("OSGi bootstra completed in " + + Math.round(((double) duration) / 1000) + "s (" + duration + + "ms), " + bundleContext.getBundles().length + " bundles"); System.out.println(); }