Author: fmeschbe
Date: Mon Jan 19 06:56:09 2009
New Revision: 735719
URL: http://svn.apache.org/viewvc?rev=735719&view=rev
Log:
Documentation update
Removed:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServlet.java
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Launcher.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/shared/Notifiable.java
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Launcher.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Launcher.java?rev=735719&r1=735718&r2=735719&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Launcher.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Launcher.java
Mon Jan 19 06:56:09 2009
@@ -18,21 +18,39 @@
*/
package org.apache.sling.launchpad.base.shared;
+/**
+ * The <code>Launcher</code> interface is implemented by the delegate classes
+ * inside the Launcher JAR and are used by the actual Main class or servlet to
+ * configure and start the framework.
+ */
public interface Launcher {
+ /**
+ * Sets the sling.home to be used for starting the framework. This method
+ * must be called with a non-<code>null</code> argument before trying to
+ * start the framework.
+ */
public void setSlingHome(String slingHome);
-
+
+ /**
+ * The {...@link Notifiable} to notify on framework stop or update
+ */
public void setNotifiable(Notifiable notifiable);
+ /**
+ * The commandline provided from the standalone launch case.
+ */
public void setCommandLine(String[] args);
- // starts the framework
- // sets command line arguments, mainly used by the main class
+ /**
+ * Starts the framework and returns <code>true</code> if successfull.
+ */
public boolean start();
- // stops the framework
- // this method only returns when the framework has actually been stopped.
- // this method may be used by the main class or servlet to initiate a
- // shutdown of the framework
+ /**
+ * Stops the framework. This method only returns when the framework has
+ * actually been stopped. This method may be used by the main class or
+ * servlet to initiate a shutdown of the framework.
+ */
public void stop();
}
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=735719&r1=735718&r2=735719&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
Mon Jan 19 06:56:09 2009
@@ -29,6 +29,10 @@
import java.net.URLClassLoader;
import java.net.URLConnection;
+/**
+ * The <code>Loader</code> class provides utility methods for the actual
+ * launchers to help launching the framework.
+ */
public class Loader {
/**
@@ -88,7 +92,6 @@
* Java VM as possible. Most notably the following traces are removed:
* <ul>
* <li>JavaBeans property caches
- * <li>Java Logging caches
* </ul>
* <p>
* This method must be called when the notifier is called.
@@ -101,6 +104,14 @@
}
+ /**
+ * Copies the contents of the launcher JAR as indicated by the URL to the
+ * sling home directory and sets the last modification time stamp fo the
+ * file. If the existing file is not older than the contents of the
launcher
+ * JAR file, the file is not replaced.
+ *
+ * @throws IOException If an error occurrs transferring the contents
+ */
public static boolean installLauncherJar(URL launcherJar, String slingHome)
throws IOException {
File launcherJarDestFile = getLauncherJarFile(slingHome);
@@ -121,6 +132,14 @@
return true;
}
+ /**
+ * Spools the contents of the input stream to the given file replacing the
+ * contents of the file with the contents of the input stream. When this
+ * method returns, the input stream is guaranteed to be closed.
+ *
+ * @throws IOException If an error occurrs reading or writing the input
+ * stream contents.
+ */
public static void spool(InputStream ins, File destFile) throws
IOException {
OutputStream out = null;
try {
@@ -146,6 +165,13 @@
}
}
+ /**
+ * Returns a <code>File</code> object representing the Launcher JAR file
+ * found in the sling home folder.
+ *
+ * @throws IllegalArgumentException if the sling home folder cannot be
+ * created or exists as a non-directory filesystem entry.
+ */
private static File getLauncherJarFile(String slingHome) {
if (slingHome == null) {
slingHome = SharedConstants.SLING_HOME_DEFAULT;
Modified:
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Notifiable.java
URL:
http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Notifiable.java?rev=735719&r1=735718&r2=735719&view=diff
==============================================================================
---
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Notifiable.java
(original)
+++
incubator/sling/whiteboard/fmeschbe/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Notifiable.java
Mon Jan 19 06:56:09 2009
@@ -20,10 +20,33 @@
import java.io.File;
+/**
+ * The <code>Notifiable</code> interface is implemented by the real main class
+ * and Sling Servlet for them to be notified from the launcher JAR when the
+ * framework has been stopped or updated.
+ */
public interface Notifiable {
+ /**
+ * Called when the OSGi framework has been stopped because the
+ * <code>Bundle.stop</code> method has been called on the system bundle.
+ */
void stopped();
+ /**
+ * Called when the OSGi framework has been stopped because any of the
+ * <code>Bundle.update</code> methods has been called on the system bundle.
+ * <p>
+ * If a temporary file is provided in the <code>tmpFile</code> parameter,
+ * that file must be used to replace the current Launcher JAR file and must
+ * be used for restarting the framework. Otherwise the framework is
+ * restarted from the existing Launcher JAR file.
+ *
+ * @param tmpFile A temporary file containing the contents of the
+ * <code>InputStream</code> given to the
+ * <code>Bundle.update(InputStream)</code> method. If no input
+ * stream has been provided, this parameter is
<code>null</code>.
+ */
void updated(File tmpFile);
}