Author: fmeschbe
Date: Fri Jan 16 04:45:20 2009
New Revision: 734990
URL: http://svn.apache.org/viewvc?rev=734990&view=rev
Log:
Code Reorganization along the lines of the correct package name
Added:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/
(props changed)
- copied from r734948,
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launcher/app/
Removed:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launcher/app/
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/resources/WEB-INF/
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/pom.xml
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/app/Main.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ClassLoaderResourceProvider.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextConnection.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextProtocolHandler.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DeploymentPackageInstaller.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ResourceProvider.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/main/SlingMain.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Loader.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServlet.java
Modified: incubator/sling/whiteboard/fmeschbe/launchpad/base/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/pom.xml?rev=734990&r1=734989&r2=734990&view=diff
==============================================================================
--- incubator/sling/whiteboard/fmeschbe/launchpad/base/pom.xml (original)
+++ incubator/sling/whiteboard/fmeschbe/launchpad/base/pom.xml Fri Jan 16
04:45:20 2009
@@ -100,19 +100,63 @@
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
- <id>jar1</id>
+ <id>base-app</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
- <classifier>shared</classifier>
+ <archive>
+ <manifest>
+ <mainClass>
+ org.apache.sling.launchpad.app.Main
+ </mainClass>
+ <addDefaultImplementationEntries>
+ true
+ </addDefaultImplementationEntries>
+ </manifest>
+ </archive>
+ <classifier>app</classifier>
<includes>
<include>org/apache/sling/launchpad/base/shared/**</include>
+
<include>org/apache/sling/launchpad/app/**</include>
+ <include>META-INF/**</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>base-webapp</id>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>
+ true
+ </addDefaultImplementationEntries>
+ </manifest>
+ </archive>
+ <classifier>webapp</classifier>
+ <!--
<webXml>${basedir}/target/classes/WEB-INF/web.xml</webXml> -->
+ <packagingExcludes>
+ WEB-INF/classes/*,
+ WEB-INF/classes/META-INF/**,
+
WEB-INF/classes/org/apache/sling/launchpad/app/*,
+
WEB-INF/classes/org/apache/sling/launchpad/base/impl/*,
+
WEB-INF/classes/org/apache/sling/launchpad/base/main/*,
+
WEB-INF/classes/org/apache/sling/launchpad/base/webapp/*,
+
WEB-INF/classes/org/apache/sling/launchpad/base/main/*
+ </packagingExcludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<reporting>
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/app/Main.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/app/Main.java?rev=734990&r1=734989&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/app/Main.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/app/Main.java
Fri Jan 16 04:45:20 2009
@@ -26,10 +26,10 @@
import java.net.MalformedURLException;
import java.net.URL;
-import org.apache.sling.launcher.app.Sling;
import org.apache.sling.launchpad.base.shared.Launcher;
import org.apache.sling.launchpad.base.shared.Loader;
import org.apache.sling.launchpad.base.shared.Notifiable;
+import org.apache.sling.launchpad.base.shared.SharedConstants;
/**
* The <code>Main</code> class is a simple Java Application which interprests
@@ -67,163 +67,165 @@
*/
public class Main extends Thread implements Notifiable {
- public static void main(String[] args) {
- new Main(args);
- }
-
- private final String[] commandLineArgs;
-
- private final String slingHome;
-
- private Launcher sling;
-
- private Main(String[] args) {
-
- // set the thread name
- super("Sling Terminator");
-
- // sling.home from the command line or system properties, else
default
- String slingHome = getSlingHome(args);
- if (slingHome == null) {
- slingHome = System.getProperty("sling.home", "sling");
- }
- info("Starting Sling in " + slingHome, null);
-
- this.commandLineArgs = args;
- this.slingHome = slingHome;
-
- Runtime.getRuntime().addShutdownHook(this);
-
- // ensure up-to-date launcher jar
-
startSling(getClass().getResource(Loader.DEFAULT_SLING_LAUNCHER_JAR));
- }
-
- private void startSling(URL launcherJar) {
- if (launcherJar != null) {
- try {
- Loader.installLauncherJar(launcherJar,
slingHome);
- } catch (IOException ioe) {
- error("Failed installing " + launcherJar, ioe);
- }
- } else {
- info("No Launcher JAR to install", null);
- }
-
- Object object;
- try {
- object = Loader.loadLauncher(Loader.DEFAULT_SLING_MAIN,
slingHome);
- } catch (IllegalArgumentException iae) {
- error("Failed loading Sling class " +
Loader.DEFAULT_SLING_MAIN,
- iae);
- return;
- }
-
- if (object instanceof Launcher) {
-
- // configure the launcher
- Launcher sling = (Launcher) object;
- sling.setNotifiable(this);
- sling.setCommandLine(commandLineArgs);
- sling.setSlingHome(slingHome);
-
- // launch it
- if (sling.start()) {
- this.sling = sling;
- }
- }
- }
-
- public void stopped() {
- /**
- * This method is called if the framework is stopped from
within by
- * calling stop on the system bundle or if the framework is
stopped
- * because the VM is going down and the shutdown hook has
initated the
- * shutdown In any case we ensure the reference to the
framework is
- * removed and remove the shutdown hook (but don't care if that
fails).
- */
-
- System.out.println("Sling has been stopped");
-
- // clear the reference to the framework
- sling = null;
-
- // remove the shutdown hook, the framework has terminated and
- // we do not need to do anything else
- try {
- Runtime.getRuntime().removeShutdownHook(this);
- } catch (Throwable t) {
- // don't care for problems removing the hook
- }
- }
-
- public void updated(File updateFile) {
- if (updateFile == null) {
-
- System.out.println("Restarting ....");
- startSling(null);
-
- } else {
-
- System.out.println("Sling has been updated with " +
updateFile);
- try {
- startSling(updateFile.toURL());
- } catch (MalformedURLException mue) {
- // TODO: Shout !
- } finally {
- updateFile.delete();
- }
-
- }
- }
-
- public void run() {
- if (sling != null) {
- sling.stop();
- }
- }
-
- private static String getSlingHome(String[] args) {
- for (int argc = 0; argc < args.length; argc++) {
- String arg = args[argc];
- if (arg.startsWith("-") && arg.length() == 2
- && arg.charAt(1) == 'c') {
- argc++;
- return (argc < args.length) ? args[argc] : null;
- }
- }
-
- return null;
- }
-
- private static void info(String message, Throwable t) {
- log(System.out, "INF: ", message, t);
- }
-
- private static void warn(String message, Throwable t) {
- log(System.out, "WRN: ", message, t);
- }
-
- private static void error(String message, Throwable t) {
- log(System.err, "ERR: ", message, t);
- }
-
- private static void log(PrintStream out, String prefix, String message,
Throwable t) {
- out.print(prefix);
- out.println(message);
- if (t != null) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- t.printStackTrace(pw);
- pw.close();
- BufferedReader br = new BufferedReader(new
StringReader(sw.toString()));
- String line;
- try {
- while ((line = br.readLine()) != null) {
- out.print(prefix);
- out.println(line);
- }
- } catch (IOException ignore) {
- }
- }
- }
+ public static void main(String[] args) {
+ new Main(args);
+ }
+
+ private final String[] commandLineArgs;
+
+ private final String slingHome;
+
+ private Launcher sling;
+
+ private Main(String[] args) {
+
+ // set the thread name
+ super("Sling Terminator");
+
+ // sling.home from the command line or system properties, else default
+ String slingHome = getSlingHome(args);
+ info("Starting Sling in " + slingHome, null);
+
+ this.commandLineArgs = args;
+ this.slingHome = slingHome;
+
+ Runtime.getRuntime().addShutdownHook(this);
+
+ // ensure up-to-date launcher jar
+ startSling(getClass().getResource(
+ SharedConstants.DEFAULT_SLING_LAUNCHER_JAR));
+ }
+
+ private void startSling(URL launcherJar) {
+ if (launcherJar != null) {
+ try {
+ Loader.installLauncherJar(launcherJar, slingHome);
+ } catch (IOException ioe) {
+ error("Failed installing " + launcherJar, ioe);
+ }
+ } else {
+ info("No Launcher JAR to install", null);
+ }
+
+ Object object;
+ try {
+ object = Loader.loadLauncher(SharedConstants.DEFAULT_SLING_MAIN,
+ slingHome);
+ } catch (IllegalArgumentException iae) {
+ error("Failed loading Sling class "
+ + SharedConstants.DEFAULT_SLING_MAIN, iae);
+ return;
+ }
+
+ if (object instanceof Launcher) {
+
+ // configure the launcher
+ Launcher sling = (Launcher) object;
+ sling.setNotifiable(this);
+ sling.setCommandLine(commandLineArgs);
+ sling.setSlingHome(slingHome);
+
+ // launch it
+ if (sling.start()) {
+ this.sling = sling;
+ }
+ }
+ }
+
+ public void stopped() {
+ /**
+ * This method is called if the framework is stopped from within by
+ * calling stop on the system bundle or if the framework is stopped
+ * because the VM is going down and the shutdown hook has initated the
+ * shutdown In any case we ensure the reference to the framework is
+ * removed and remove the shutdown hook (but don't care if that fails).
+ */
+
+ info("Sling has been stopped", null);
+
+ // clear the reference to the framework
+ sling = null;
+
+ // remove the shutdown hook, the framework has terminated and
+ // we do not need to do anything else
+ try {
+ Runtime.getRuntime().removeShutdownHook(this);
+ } catch (Throwable t) {
+ // don't care for problems removing the hook
+ }
+ }
+
+ public void updated(File updateFile) {
+ if (updateFile == null) {
+
+ info("Restarting Framework and Sling", null);
+ startSling(null);
+
+ } else {
+
+ info("Restarting Framework with update from " + updateFile, null);
+ try {
+ startSling(updateFile.toURI().toURL());
+ } catch (MalformedURLException mue) {
+ error("Cannot get URL for file " + updateFile, mue);
+ } finally {
+ updateFile.delete();
+ }
+
+ }
+ }
+
+ public void run() {
+ if (sling != null) {
+ sling.stop();
+ }
+ }
+
+ private static String getSlingHome(String[] args) {
+ for (int argc = 0; argc < args.length; argc++) {
+ String arg = args[argc];
+ if (arg.startsWith("-") && arg.length() == 2
+ && arg.charAt(1) == 'c') {
+ argc++;
+ return (argc < args.length) ? args[argc] : null;
+ }
+ }
+
+ return System.getProperty(SharedConstants.SLING_HOME,
+ SharedConstants.SLING_HOME_DEFAULT);
+ }
+
+ private static void info(String message, Throwable t) {
+ log(System.out, "INF: ", message, t);
+ }
+
+ private static void warn(String message, Throwable t) {
+ log(System.out, "WRN: ", message, t);
+ }
+
+ private static void error(String message, Throwable t) {
+ log(System.err, "ERR: ", message, t);
+ }
+
+ private static void log(PrintStream out, String prefix, String message,
+ Throwable t) {
+ out.print(prefix);
+ out.println(message);
+ if (t != null) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ t.printStackTrace(pw);
+ pw.close();
+ BufferedReader br = new BufferedReader(new StringReader(
+ sw.toString()));
+ String line;
+ try {
+ while ((line = br.readLine()) != null) {
+ out.print(prefix);
+ out.println(line);
+ }
+ } catch (IOException ignore) {
+ }
+ }
+ }
}
Propchange:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/
------------------------------------------------------------------------------
svn:mergeinfo =
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java
Fri Jan 16 04:45:20 2009
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import java.io.File;
import java.io.FileInputStream;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ClassLoaderResourceProvider.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ClassLoaderResourceProvider.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ClassLoaderResourceProvider.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ClassLoaderResourceProvider.java
Fri Jan 16 04:45:20 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import java.io.IOException;
import java.net.JarURLConnection;
@@ -75,7 +75,7 @@
}
/**
- * @see
org.apache.sling.launcher.app.ResourceProvider#getResource(java.lang.String)
+ * @see
org.apache.sling.launchpad.base.impl.ResourceProvider#getResource(java.lang.String)
*/
public URL getResource(String path) {
// ensure path
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextConnection.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextConnection.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextConnection.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextConnection.java
Fri Jan 16 04:45:20 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import java.io.IOException;
import java.io.InputStream;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextProtocolHandler.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextProtocolHandler.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextProtocolHandler.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ContextProtocolHandler.java
Fri Jan 16 04:45:20 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import java.net.URL;
import java.net.URLConnection;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DeploymentPackageInstaller.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DeploymentPackageInstaller.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DeploymentPackageInstaller.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DeploymentPackageInstaller.java
Fri Jan 16 04:45:20 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import java.io.File;
import java.io.FileInputStream;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ResourceProvider.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ResourceProvider.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ResourceProvider.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/ResourceProvider.java
Fri Jan 16 04:45:20 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import java.io.IOException;
import java.io.InputStream;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
Fri Jan 16 04:45:20 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import static
org.apache.felix.framework.util.FelixConstants.EMBEDDED_EXECUTION_PROP;
@@ -41,6 +41,7 @@
import org.apache.felix.framework.Felix;
import org.apache.felix.framework.Logger;
import org.apache.sling.launchpad.base.shared.Notifiable;
+import org.apache.sling.launchpad.base.shared.SharedConstants;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -97,7 +98,7 @@
*
* @see #SLING_HOME_URL
*/
- public static final String SLING_HOME = "sling.home";
+// public static final String SLING_HOME = "sling.home";
/**
* The name of the configuration property defining the Sling home directory
@@ -339,13 +340,13 @@
}
// check whether sling.home is overwritten by system property
- String slingHome = props.get(SLING_HOME);
+ String slingHome = props.get(SharedConstants.SLING_HOME);
if (slingHome == null || slingHome.length() == 0) {
throw new BundleException("sling.home property is missing, cannot
start");
}
// resolve variables and ensure sling.home is an absolute path
- slingHome = substVars(slingHome, SLING_HOME, null, props);
+ slingHome = substVars(slingHome, SharedConstants.SLING_HOME, null,
props);
File slingHomeFile = new File(slingHome).getAbsoluteFile();
slingHome = slingHomeFile.getAbsolutePath();
@@ -385,8 +386,8 @@
// reset back the sling home property
// might have been overwritten by system properties, included
// files or the sling.properties file
- origProps.put(SLING_HOME, slingHome);
- props.put(SLING_HOME, slingHome);
+ origProps.put(SharedConstants.SLING_HOME, slingHome);
+ props.put(SharedConstants.SLING_HOME, slingHome);
props.put(SLING_HOME_URL, slingHomeFile.toURI().toString());
// Perform variable substitution for system properties.
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java?rev=734990&r1=734948&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
Fri Jan 16 04:45:20 2009
@@ -12,7 +12,7 @@
* accordance with the terms of the license agreement you entered into
* with Day.
*/
-package org.apache.sling.launcher.app;
+package org.apache.sling.launchpad.base.impl;
import java.io.File;
import java.io.IOException;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/main/SlingMain.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/main/SlingMain.java?rev=734990&r1=734989&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/main/SlingMain.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/main/SlingMain.java
Fri Jan 16 04:45:20 2009
@@ -23,11 +23,12 @@
import org.apache.felix.framework.Logger;
import org.apache.sling.commons.log.LogManager;
-import org.apache.sling.launcher.app.ClassLoaderResourceProvider;
-import org.apache.sling.launcher.app.ResourceProvider;
-import org.apache.sling.launcher.app.Sling;
+import org.apache.sling.launchpad.base.impl.ClassLoaderResourceProvider;
+import org.apache.sling.launchpad.base.impl.ResourceProvider;
+import org.apache.sling.launchpad.base.impl.Sling;
import org.apache.sling.launchpad.base.shared.Launcher;
import org.apache.sling.launchpad.base.shared.Notifiable;
+import org.apache.sling.launchpad.base.shared.SharedConstants;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
@@ -61,8 +62,8 @@
* overwrites the <code>org.osgi.service.http.port</code> setting the
* <code>sling.properties</code> file.</dd>
* <dt>-h</dt>
- * <dd>Prints a simple usage message listing all available command line
- * options.</dd>
+ * <dd>Prints a simple usage message listing all available command line
options.
+ * </dd>
* </dl>
*/
public class SlingMain implements Launcher {
@@ -90,25 +91,23 @@
private static final String DEFAULT_PORT = "8080";
/**
- * The property value to export the Servlet API 2.5 from the system
- * bundle.
+ * The property value to export the Servlet API 2.5 from the system bundle.
*/
- private static final String SERVLET_API_EXPORT =
- "javax.servlet;javax.servlet.http;javax.servlet.resources;
version=2.5";
+ private static final String SERVLET_API_EXPORT =
"javax.servlet;javax.servlet.http;javax.servlet.resources; version=2.5";
private Notifiable notifiable;
-
+
/** The parsed command line mapping (Sling) option name to option value */
private Map<String, String> commandLine;
-
+
private String slingHome;
private Sling sling;
-
+
public void setNotifiable(Notifiable notifiable) {
this.notifiable = notifiable;
}
-
+
public void setCommandLine(String[] args) {
commandLine = new HashMap<String, String>();
commandLine.put(PROP_PORT, DEFAULT_PORT);
@@ -118,9 +117,9 @@
public void setSlingHome(String slingHome) {
this.slingHome = slingHome;
}
-
+
public boolean start() {
-
+
Map<String, String> props = new HashMap<String, String>();
// parse the command line (exit in case of failure)
@@ -130,9 +129,10 @@
// if sling.home was set on the command line, set it in the properties
if (slingHome != null) {
- props.put(Sling.SLING_HOME, slingHome);
- } else if (commandLine.containsKey(Sling.SLING_HOME)) {
- props.put(Sling.SLING_HOME, commandLine.get(Sling.SLING_HOME));
+ props.put(SharedConstants.SLING_HOME, slingHome);
+ } else if (commandLine.containsKey(SharedConstants.SLING_HOME)) {
+ props.put(SharedConstants.SLING_HOME,
+ commandLine.get(SharedConstants.SLING_HOME));
}
// set up and configure Felix Logger
@@ -152,12 +152,15 @@
try {
ResourceProvider resProvider = new ClassLoaderResourceProvider(
SlingMain.class.getClassLoader());
-
- // creating the instance launches the framework and we are done
here ..
+
+ // creating the instance launches the framework and we are done
here
+ // ..
sling = new Sling(notifiable, logger, resProvider, props) {
-
- // overwrite the loadPropertiesOverride method to inject the
command
- // line arguments unconditionally. These will not be persisted
in any
+
+ // overwrite the loadPropertiesOverride method to inject the
+ // command
+ // line arguments unconditionally. These will not be persisted
+ // in any
// properties file, though
protected void loadPropertiesOverride(
Map<String, String> properties) {
@@ -176,7 +179,7 @@
sysExport);
}
};
-
+
// we successfully started it
return true;
@@ -248,7 +251,7 @@
usage("Missing directory value", 1);
continue;
}
- props.put(Sling.SLING_HOME, value);
+ props.put(SharedConstants.SLING_HOME, value);
break;
case 'p':
@@ -321,7 +324,9 @@
return null;
}
- /** Verifies the log level is one of the known values, returns null
otherwise */
+ /**
+ * Verifies the log level is one of the known values, returns null
otherwise
+ */
private static String checkLogLevel(String level) {
for (int i = 0; i < logLevels.length; i++) {
if (logLevels[i].equalsIgnoreCase(level)) {
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Loader.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Loader.java?rev=734990&r1=734989&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Loader.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Loader.java
Fri Jan 16 04:45:20 2009
@@ -31,16 +31,6 @@
public class Loader {
- public static final String LAUNCHER_JAR_REL_PATH = "slinglauncher.jar";
-
- public static final String SLING_HOME_DEFAULT = "sling";
-
- public static final String DEFAULT_SLING_MAIN =
"org.apache.sling.launchpad.base.main.SlingMain";
-
- public static final String DEFAULT_SLING_SERVLET =
"org.apache.sling.launchpad.base.webapp.SlingServlet";
-
- public static final String DEFAULT_SLING_LAUNCHER_JAR =
"/resources/org.apache.sling.launchpad.base-2.0.3-incubator-SNAPSHOT.jar";
-
/**
* Creates an URLClassLoader from a _launcher JAR_ file in the given
* slingHome directory and loads and returns the launcher class identified
@@ -158,7 +148,7 @@
private static File getLauncherJarFile(String slingHome) {
if (slingHome == null) {
- slingHome = SLING_HOME_DEFAULT;
+ slingHome = SharedConstants.SLING_HOME_DEFAULT;
}
File slingDir = new File(slingHome).getAbsoluteFile();
@@ -172,6 +162,6 @@
+ " cannot be created as a directory");
}
- return new File(slingDir, LAUNCHER_JAR_REL_PATH);
+ return new File(slingDir, SharedConstants.LAUNCHER_JAR_REL_PATH);
}
}
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java?rev=734990&r1=734989&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
Fri Jan 16 04:45:20 2009
@@ -19,8 +19,8 @@
import java.util.Map;
import org.apache.felix.framework.Logger;
-import org.apache.sling.launcher.app.ResourceProvider;
-import org.apache.sling.launcher.app.Sling;
+import org.apache.sling.launchpad.base.impl.ResourceProvider;
+import org.apache.sling.launchpad.base.impl.Sling;
import org.apache.sling.launchpad.base.shared.Notifiable;
import org.eclipse.equinox.http.servlet.internal.Activator;
import org.osgi.framework.BundleActivator;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServlet.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServlet.java?rev=734990&r1=734989&r2=734990&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServlet.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServlet.java
Fri Jan 16 04:45:20 2009
@@ -34,15 +34,15 @@
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.felix.framework.Logger;
-import org.apache.sling.launcher.app.ClassLoaderResourceProvider;
-import org.apache.sling.launcher.app.ResourceProvider;
-import org.apache.sling.launcher.app.Sling;
+import org.apache.sling.launchpad.base.impl.ClassLoaderResourceProvider;
+import org.apache.sling.launchpad.base.impl.ResourceProvider;
+import org.apache.sling.launchpad.base.impl.Sling;
import org.apache.sling.launchpad.base.shared.Launcher;
import org.apache.sling.launchpad.base.shared.Notifiable;
+import org.apache.sling.launchpad.base.shared.SharedConstants;
import org.eclipse.equinox.http.servlet.HttpServiceServlet;
import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
@@ -341,9 +341,6 @@
// prevent system properties from being considered
props.put(Sling.SLING_IGNORE_SYSTEM_PROPERTIES, "true");
- // add optional boot delegation for JCR and Jackrabbit API
- props.put("sling.include.jcr-client", "jcr-client.properties");
-
// copy context init parameters
@SuppressWarnings("unchecked")
Enumeration<String> pe = getServletContext().getInitParameterNames();
@@ -374,7 +371,7 @@
}
// set sling home
- props.put(Sling.SLING_HOME, slingHome);
+ props.put(SharedConstants.SLING_HOME, slingHome);
return props;
}