Minor modifications to improve main and align it wit the new API. (FELIX-753)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@705298 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/main/src/main/java/org/apache/felix/main/AutoActivator.java b/main/src/main/java/org/apache/felix/main/AutoActivator.java
index 387d9c5..10dce76 100644
--- a/main/src/main/java/org/apache/felix/main/AutoActivator.java
+++ b/main/src/main/java/org/apache/felix/main/AutoActivator.java
@@ -88,7 +88,7 @@
// level is assumed.
for (Iterator i = m_configMap.keySet().iterator(); i.hasNext(); )
{
- String key = (String) i.next();
+ String key = ((String) i.next()).toLowerCase();
// Ignore all keys that are not an auto property.
if (!key.startsWith(AUTO_INSTALL_PROP) && !key.startsWith(AUTO_START_PROP))
@@ -131,7 +131,7 @@
// Now loop through the auto-start bundles and start them.
for (Iterator i = m_configMap.keySet().iterator(); i.hasNext(); )
{
- String key = (String) i.next();
+ String key = ((String) i.next()).toLowerCase();
if (key.startsWith(AUTO_START_PROP))
{
StringTokenizer st = new StringTokenizer((String) m_configMap.get(key), "\" ", true);
diff --git a/main/src/main/java/org/apache/felix/main/Main.java b/main/src/main/java/org/apache/felix/main/Main.java
index 8540813..26f946d 100644
--- a/main/src/main/java/org/apache/felix/main/Main.java
+++ b/main/src/main/java/org/apache/felix/main/Main.java
@@ -22,9 +22,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
-
import org.apache.felix.framework.Felix;
-import org.apache.felix.framework.util.StringMap;
+import org.apache.felix.framework.util.FelixConstants;
import org.osgi.framework.Constants;
/**
@@ -164,7 +163,6 @@
* @param argv An array of arguments, all of which are ignored.
* @throws Exception If an error occurs.
**/
-
public static void main(String[] args) throws Exception
{
// We support at most one argument, which is the bundle
@@ -191,23 +189,24 @@
configProps.setProperty(Constants.FRAMEWORK_STORAGE, args[0]);
}
+ // Create a list for custom framework activators and
+ // add an instance of the auto-activator it for processing
+ // auto-install and auto-start properties. Add this list
+ // to the configuration properties.
+ List list = new ArrayList();
+ list.add(new AutoActivator(configProps));
+ configProps.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
+
// Print welcome banner.
System.out.println("\nWelcome to Felix.");
System.out.println("=================\n");
try
{
- // Create a list for custom framework activators and
- // add an instance of the auto-activator it for processing
- // auto-install and auto-start properties.
- List list = new ArrayList();
- list.add(new AutoActivator(configProps));
- // Create a case-insensitive property map.
- Map configMap = new StringMap(configProps, false);
- configMap.put("felix.systembundle.activators", list);
- // Create an instance of the framework.
- m_felix = new Felix(configMap);
+ // Create an instance and start the framework.
+ m_felix = new Felix(configProps);
m_felix.start();
+ // Wait for framework to stop to exit the VM.
m_felix.waitForStop(0);
System.exit(0);
}