Revision: 40
http://techne-dev.svn.sourceforge.net/techne-dev/?rev=40&view=rev
Author: rickles
Date: 2007-02-11 16:23:54 -0800 (Sun, 11 Feb 2007)
Log Message:
-----------
Create a simple Felix launcher for testing purposes.
Added Paths:
-----------
sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/launch/
sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/launch/felix/
sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/launch/felix/FelixLauncher.java
Added: sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/launch/felix/FelixLauncher.java
===================================================================
--- sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/launch/felix/FelixLauncher.java (rev 0)
+++ sandbox/rickles/org.digivitality.techne.core/src/org/digivitality/techne/launch/felix/FelixLauncher.java 2007-02-12 00:23:54 UTC (rev 40)
@@ -0,0 +1,48 @@
+package org.digivitality.techne.launch.felix;
+
+import java.io.*;
+import java.util.*;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.felix.framework.Felix;
+import org.apache.felix.main.Main;
+import org.apache.felix.framework.util.*;
+import org.digivitality.techne.shell.Shell;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Just a simple launcher for testing Felix
+ *
+ */
+
+public class FelixLauncher {
+
+ private BundleContext context;
+ private Felix felix;
+ protected static final Log logger = LogFactory.getLog(FelixLauncher.class);
+
+ protected Properties getFelixConfiguration() throws Exception {
+ Main.loadSystemProperties();
+ Properties configProps = Main.loadConfigProperties();
+ return configProps;
+ }
+
+ public void launch() {
+ try
+ {
+ felix = new Felix();
+ felix.start(new MutablePropertyResolverImpl(new StringMap(getFelixConfiguration(), false)),
+ null, null);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ }
+ }
+
+ public Felix getFelix() {
+ return felix;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|