Index: /trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/JarLauncher.java
===================================================================
--- /trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/JarLauncher.java	(revision 264)
+++ /trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/JarLauncher.java	(revision 265)
@@ -12,26 +12,96 @@
 import java.util.jar.Manifest;
 
+/**
+ * <p>
+ * Class that launches an executable Jar-file in the same thread and VM where
+ * the JarLauncher instance is created. The requirements on the Jar file are:
+ * <li>Must contain a MANIFEST.</li>
+ * <li>The MANIFEST must define the main-class of the application ("Main-Class"
+ * entry).</li>
+ * <li>The MANIFEST must define the classpath of the application ("Class-Path"
+ * entry).</li>
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
 public class JarLauncher {
 
-	String workingDir = System.getProperty("user.dir") + "/";
-	String jarfile;
-	String[] args;
-
-	String[] classPath = new String[] {};
-	String mainClassName = "";
-	ClassLoader costumClassLoader;
-
-	public class JarLaunchException extends Exception {
-
+	/**
+	 * <p>
+	 * Name of the Jar file to be executed.
+	 * </p>
+	 */
+	private String jarfile;
+
+	/**
+	 * <p>
+	 * Arguments for launching the Jar file.
+	 * </p>
+	 */
+	private String[] args;
+
+	/**
+	 * <p>
+	 * Helper variable with the path to the working directory.
+	 * </p>
+	 */
+	final String workingDir = System.getProperty("user.dir") + "/";
+
+	/**
+	 * <p>
+	 * Internal variable used to store the classpath extracted from the Jar
+	 * file's MANIFEST.
+	 * </p>
+	 */
+	private String[] classPath = new String[] {};
+
+	/**
+	 * <p>
+	 * Internal variable used to store the name (including package information)
+	 * of the Jar file's main function extracted from the Jar file's MANIFEST.
+	 * </p>
+	 */
+	private String mainClassName = "";
+
+	/**
+	 * <p>
+	 * Inner class that defines an exception that is thrown if launching the
+	 * application in the Jar file fails.
+	 * </p>
+	 * 
+	 * @author Steffen Herbold
+	 * @version 1.0
+	 */
+	private class JarLaunchException extends Exception {
+
+		/**
+		 * <p>
+		 * Id for object serialization.
+		 * </p>
+		 */
 		private static final long serialVersionUID = 1L;
 
-		public JarLaunchException() {
-			super();
-		}
-
+		/**
+		 * <p>
+		 * Constructor. Creates a new JarLaunchException.
+		 * </p>
+		 * 
+		 * @param string
+		 *            error message of the exception
+		 */
 		public JarLaunchException(String string) {
 			super(string);
 		}
 
+		/**
+		 * <p>
+		 * Constructor. Creates a new JarLaunchException as a copy of an
+		 * existing exception.
+		 * </p>
+		 * 
+		 * @param e
+		 *            exception that is copied
+		 */
 		public JarLaunchException(Exception e) {
 			super(e);
@@ -40,4 +110,16 @@
 	}
 
+	/**
+	 * <p>
+	 * Constructor. Creates a new JarLauncher.
+	 * </p>
+	 * 
+	 * @param jarfileJjar
+	 *            file to be launched; must not be complete path but in relation
+	 *            to the current working directory
+	 * @param args
+	 *            arguments with which the main function of the Jar file is
+	 *            called
+	 */
 	public JarLauncher(String jarfile, String[] args) {
 		this.jarfile = jarfile;
@@ -45,9 +127,14 @@
 	}
 
+	/**
+	 * <p>
+	 * Executes the main function of the Jar file associated with this launcher.
+	 * </p>
+	 */
 	public void exec() {
 		try {
 			getInfoFromJar();
 			initClassLoader();
-			startSUT();
+			runMain();
 		} catch (JarLaunchException e) {
 			System.err.println("Failure to launch application.");
@@ -56,4 +143,12 @@
 	}
 
+	/**
+	 * <p>
+	 * Retrieves the classpath and main function from the Jar file's MANIFEST.
+	 * </p>
+	 * 
+	 * @throws JarLaunchException
+	 *             thrown if reading of Jar file or MANIFEST fails
+	 */
 	private void getInfoFromJar() throws JarLaunchException {
 		JarInputStream jarInputStream;
@@ -77,4 +172,13 @@
 	}
 
+	/**
+	 * <p>
+	 * Modifies the {@link ClassLoader} of the current VM such that it includes
+	 * the class path defined in the Jar file's MANIFEST.
+	 * </p>
+	 * 
+	 * @throws JarLaunchException
+	 *             thrown if modification of {@link ClassLoader} fails.
+	 */
 	private void initClassLoader() throws JarLaunchException {
 		URLClassLoader classLoader = (URLClassLoader) ClassLoader
@@ -112,5 +216,14 @@
 	}
 
-	private void startSUT() throws JarLaunchException {
+	/**
+	 * <p>
+	 * Executes the main function.
+	 * </p>
+	 * 
+	 * @throws JarLaunchException
+	 *             thrown if execution of main function fails or the main
+	 *             function itself throws an exception
+	 */
+	private void runMain() throws JarLaunchException {
 		Class<?> mainClass;
 		try {
