Introduce OSGi standard runtime
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 9 May 2010 08:08:09 +0000 (08:08 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 9 May 2010 08:08:09 +0000 (08:08 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@3575 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

osgi/dep/org.argeo.osgi.dep.stdruntime/pom.xml [new file with mode: 0644]
osgi/dep/pom.xml [new file with mode: 0644]
osgi/pom.xml
osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Activator.java
osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/OsgiBoot.java

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 (file)
index 0000000..29d3ac7
--- /dev/null
@@ -0,0 +1,37 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.commons.osgi</groupId>
+               <version>0.1.3-SNAPSHOT</version>
+               <artifactId>dep</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.osgi.dep.stdruntime</artifactId>
+       <packaging>pom</packaging>
+       <name>Dep OSGi Runtime</name>
+       <dependencies>
+               <!-- OSGi Boot (and Equinox) -->
+               <dependency>
+                       <groupId>org.argeo.commons.osgi</groupId>
+                       <artifactId>org.argeo.osgi.boot</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <!--  Logging -->
+               <dependency>
+                       <groupId>org.argeo.commons.basic</groupId>
+                       <artifactId>org.argeo.basic.dep.log4j</artifactId>
+                       <version>${project.version}</version>
+                       <type>pom</type>
+               </dependency>
+               <!-- Spring OSGi -->
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>org.springframework.osgi.core</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>org.springframework.osgi.extender</artifactId>
+               </dependency>
+       </dependencies>
+</project>
\ No newline at end of file
diff --git a/osgi/dep/pom.xml b/osgi/dep/pom.xml
new file mode 100644 (file)
index 0000000..f56ec6e
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.commons</groupId>
+               <version>0.1.3-SNAPSHOT</version>
+               <artifactId>osgi</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <groupId>org.argeo.commons.osgi</groupId>
+       <artifactId>dep</artifactId>
+       <name>Commons Server Dependencies</name>
+       <packaging>pom</packaging>
+       <modules>
+               <module>org.argeo.osgi.dep.stdruntime</module>
+       </modules>
+</project>
\ No newline at end of file
index 282558762e8e3dbca8e4d4cd865d7628584cab79..302b41de5331cb6d07f59b35a7dc342c7669024c 100644 (file)
@@ -12,5 +12,6 @@
        <packaging>pom</packaging>
        <modules>
                <module>runtime</module>
+               <module>dep</module>
        </modules>
 </project>
\ No newline at end of file
index 80ec7b7f218e306c121f74832770229abc8c5d10..8397a7636c81997bfd4eddcd8d12bafb8bfddadb 100644 (file)
@@ -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 {
index d54fa88993e031f7f146e392454a46dcc9622dc3..17547f24408cc04b65fa285844da42a6c79ea7b8 100644 (file)
@@ -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();
        }