FELIX-2311: Remove the Bootstrap class which is not needed anymore
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@939602 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/assembly/src/main/distribution/unix-shell/bin/karaf b/karaf/assembly/src/main/distribution/unix-shell/bin/karaf
index d0af57b..10751af 100755
--- a/karaf/assembly/src/main/distribution/unix-shell/bin/karaf
+++ b/karaf/assembly/src/main/distribution/unix-shell/bin/karaf
@@ -266,7 +266,7 @@
run() {
OPTS="-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true"
- MAIN=org.apache.felix.karaf.main.Bootstrap
+ MAIN=org.apache.felix.karaf.main.Main
case "$1" in
'stop')
MAIN=org.apache.felix.karaf.main.Stop
@@ -291,7 +291,7 @@
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
fi
cd $KARAF_BASE
- exec $JAVA $JAVA_OPTS -Dstorage.location="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" $MAIN "$@"
+ exec $JAVA $JAVA_OPTS -Djava.endorsed.dirs="${KARAF_HOME}/lib/endorsed" -Dstorage.location="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" $MAIN "$@"
}
main() {
diff --git a/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat b/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat
index c8c3e7a..72d7b0b 100755
--- a/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat
+++ b/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat
@@ -128,7 +128,7 @@
:RUN
SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true
- SET MAIN=org.apache.felix.karaf.main.Bootstrap
+ SET MAIN=org.apache.felix.karaf.main.Main
SET SHIFT=false
if "%1" == "stop" goto :EXECUTE_STOP
if "%1" == "console" goto :EXECUTE_CONSOLE
@@ -160,7 +160,7 @@
if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8
rem Execute the Java Virtual Machine
cd %KARAF_BASE%
- "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dstorage.location="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" org.apache.felix.karaf.main.Bootstrap %ARGS%
+ "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dstorage.location="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %MAIN% %ARGS%
rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
diff --git a/karaf/demos/web/src/main/java/org/apache/felix/karaf/web/WebAppListener.java b/karaf/demos/web/src/main/java/org/apache/felix/karaf/web/WebAppListener.java
index 8db85b1..e988278 100644
--- a/karaf/demos/web/src/main/java/org/apache/felix/karaf/web/WebAppListener.java
+++ b/karaf/demos/web/src/main/java/org/apache/felix/karaf/web/WebAppListener.java
@@ -22,7 +22,6 @@
import javax.servlet.ServletContextListener;
import org.apache.felix.karaf.main.Main;
-import org.apache.felix.karaf.main.Bootstrap;
public class WebAppListener implements ServletContextListener {
@@ -37,7 +36,8 @@
System.setProperty("karaf.base", root);
System.setProperty("karaf.startLocalConsole", "false");
System.setProperty("karaf.startRemoteShell", "true");
- main = Bootstrap.launch(new String[0]);
+ main = new Main(new String[0]);
+ main.launch();
} catch (Exception e) {
main = null;
e.printStackTrace();
diff --git a/karaf/main/src/main/java/org/apache/felix/karaf/main/Bootstrap.java b/karaf/main/src/main/java/org/apache/felix/karaf/main/Bootstrap.java
deleted file mode 100644
index 6b9dd80..0000000
--- a/karaf/main/src/main/java/org/apache/felix/karaf/main/Bootstrap.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.felix.karaf.main;
-
-import java.util.Properties;
-import java.io.File;
-import java.io.InputStream;
-import java.io.FileNotFoundException;
-import java.io.FileInputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.lang.reflect.Method;
-
-public class Bootstrap {
-
- public static void main(String[] args) {
- try {
- Main.main(args);
- } catch (Throwable t) {
- t.printStackTrace();
- System.exit(-1);
- }
- }
-
- public static Main launch(String[] args) throws Exception {
- Main main = new Main(args);
- main.launch();
- return main;
- }
-
-}
diff --git a/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java b/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
index 9020673..f6df843 100644
--- a/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
+++ b/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
@@ -813,7 +813,7 @@
throw new FileNotFoundException(bundleFile.getAbsolutePath());
}
- URLClassLoader classLoader = (URLClassLoader) Bootstrap.class.getClassLoader();
+ URLClassLoader classLoader = (URLClassLoader) Main.class.getClassLoader();
Method mth = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
mth.setAccessible(true);
mth.invoke(classLoader, bundleFile.toURL());