Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/JFCLogParser.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/JFCLogParser.java	(revision 305)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/JFCLogParser.java	(revision 305)
@@ -0,0 +1,209 @@
+package de.ugoe.cs.eventbench.jfc;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.security.InvalidParameterException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import de.ugoe.cs.eventbench.jfc.data.JFCEvent;
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * This class provides functionality to parse XML log files generated by the
+ * JFCMonitor of EventBench. The result of parsing a file is a collection of
+ * event sequences.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class JFCLogParser extends DefaultHandler {
+
+	/**
+	 * <p>
+	 * Collection of event sequences that is contained in the log file, which is
+	 * parsed.
+	 * </p>
+	 */
+	private Collection<List<JFCEvent>> sequences;
+
+	/**
+	 * <p>
+	 * Internal handle to the event that is currently being parsed.
+	 * </p>
+	 */
+	private JFCEvent currentEvent;
+
+	/**
+	 * <p>
+	 * Internal handle to the event sequence that is currently being parsed.
+	 * </p>
+	 */
+	private List<JFCEvent> currentSequence = null;
+
+	/**
+	 * <p>
+	 * Enumeration to differentiate if a parameter belongs to an event, a source
+	 * or the parent of a source.
+	 * </p>
+	 * 
+	 * @author Steffen Herbold
+	 * @version 1.0
+	 */
+	private enum ParamSource {
+		EVENT, SOURCE, PARENT
+	};
+
+	/**
+	 * <p>
+	 * Specifies whether the parameters that are currently being read belong the
+	 * the event, the source or the parent.
+	 * </p>
+	 */
+	ParamSource paramSource = null;
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new JFCLogParser.
+	 * </p>
+	 */
+	public JFCLogParser() {
+		sequences = new LinkedList<List<JFCEvent>>();
+	}
+
+	/**
+	 * <p>
+	 * Returns the collection of event sequences that is obtained from parsing
+	 * log files.
+	 * </p>
+	 * 
+	 * @return collection of event sequences
+	 */
+	public Collection<List<JFCEvent>> getSequences() {
+		return sequences;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,
+	 * java.lang.String, java.lang.String, org.xml.sax.Attributes)
+	 */
+	public void startElement(String uri, String localName, String qName,
+			Attributes atts) throws SAXException {
+		if (qName.equals("newsession")) {
+			Console.traceln("start of session");
+			if (currentSequence != null && currentSequence.size() != 0) {
+				sequences.add(currentSequence);
+				currentSequence = new LinkedList<JFCEvent>();
+			}
+		} else if (qName.equals("event")) {
+			currentEvent = new JFCEvent(atts.getValue("id"));
+			paramSource = ParamSource.EVENT;
+		} else if (qName.equals("param")) {
+			if (paramSource == ParamSource.EVENT) {
+				currentEvent.addParameter(atts.getValue("name"),
+						atts.getValue("value"));
+			} else if (paramSource == ParamSource.SOURCE) {
+				currentEvent.addSourceInformation(atts.getValue("name"),
+						atts.getValue("value"));
+			} else if (paramSource == ParamSource.PARENT) {
+				currentEvent.addParentInformation(atts.getValue("name"),
+						atts.getValue("value"));
+			}
+		} else if (qName.equals("source")) {
+			paramSource = ParamSource.SOURCE;
+		} else if (qName.equals("parent")) {
+			paramSource = ParamSource.PARENT;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,
+	 * java.lang.String, java.lang.String)
+	 */
+	@Override
+	public void endElement(String uri, String localName, String qName)
+			throws SAXException {
+		if (qName.equals("event")) {
+			currentSequence.add(currentEvent);
+		} else if (qName.equals("source")) {
+			paramSource = ParamSource.EVENT;
+		} else if (qName.equals("parent")) {
+			paramSource = ParamSource.SOURCE;
+		}
+	}
+
+	/**
+	 * <p>
+	 * Parses a log file written by the JFCMonitor and creates a collection of
+	 * event sequences.
+	 * </p>
+	 * 
+	 * @param filename
+	 *            name and path of the log file
+	 */
+	public void parseFile(String filename) {
+		if (filename == null) {
+			throw new InvalidParameterException("filename must not be null");
+		}
+
+		SAXParserFactory spf = SAXParserFactory.newInstance();
+		spf.setValidating(true);
+
+		SAXParser saxParser = null;
+		InputSource inputSource = null;
+		try {
+			saxParser = spf.newSAXParser();
+			inputSource = new InputSource(new InputStreamReader(
+					new FileInputStream(filename), "UTF-16"));
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			e.printStackTrace();
+		} catch (SAXException e) {
+			e.printStackTrace();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		if (inputSource != null) {
+			inputSource.setSystemId("file://"
+					+ new File(filename).getAbsolutePath());
+			try {
+				if (saxParser == null) {
+					throw new RuntimeException("SAXParser creation failed");
+				}
+				saxParser.parse(inputSource, this);
+			} catch (SAXParseException e) {
+				Console.printerrln("Failure parsing file in line "
+						+ e.getLineNumber() + ", column " + e.getColumnNumber()
+						+ ".");
+				e.printStackTrace();
+			} catch (SAXException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDparseJFC.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDparseJFC.java	(revision 305)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDparseJFC.java	(revision 305)
@@ -0,0 +1,65 @@
+package de.ugoe.cs.eventbench.jfc.commands;
+
+import java.security.InvalidParameterException;
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.eventbench.CommandHelpers;
+import de.ugoe.cs.eventbench.data.GlobalDataContainer;
+import de.ugoe.cs.eventbench.jfc.JFCLogParser;
+import de.ugoe.cs.eventbench.jfc.data.JFCEvent;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Command to parse an XML file with sessions monitored by EventBench's
+ * JFCMonitor.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDparseJFC implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String filename;
+		String sequencesName = "sequences";
+
+		try {
+			filename = (String) parameters.get(0);
+			if (parameters.size() >= 2) {
+				sequencesName = (String) parameters.get(1);
+			}
+		} catch (Exception e) {
+			throw new InvalidParameterException();
+		}
+
+		JFCLogParser parser = new JFCLogParser();
+
+		parser.parseFile(filename);
+
+		Collection<List<JFCEvent>> sequences = parser.getSequences();
+
+		if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) {
+			CommandHelpers.dataOverwritten(sequencesName);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public void help() {
+		Console.println("Usage: parseJFC <filename> {<sequencesName>}");
+	}
+
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDpreprocessJFC.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDpreprocessJFC.java	(revision 305)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDpreprocessJFC.java	(revision 305)
@@ -0,0 +1,89 @@
+package de.ugoe.cs.eventbench.jfc.commands;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.security.InvalidParameterException;
+import java.util.List;
+
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Command to pre-process files written by EventBench's JFCMonitor. The only task
+ * of the pre-processing is checking if the session was closed properly, i.e.,
+ * if the XML file ends with a {@code </sessions>} tag. If this is not the case,
+ * the tag will be appended to the file.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDpreprocessJFC implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String source;
+		String target;
+		try {
+			source = (String) parameters.get(0);
+			target = (String) parameters.get(1);
+		} catch (Exception e) {
+			throw new InvalidParameterException();
+		}
+
+		File file = new File(source);
+		FileReader fileReader;
+		try {
+			fileReader = new FileReader(file);
+		} catch (FileNotFoundException e) {
+			Console.printerrln(e.getMessage());
+			return;
+		}
+		char[] buffer = new char[(int) file.length()];
+		try {
+			fileReader.read(buffer);
+			fileReader.close();
+		} catch (IOException e) {
+			Console.printerrln(e.getMessage());
+			return;
+		}
+
+		String content = new String(buffer).trim();
+
+		FileWriter writer;
+		try {
+			writer = new FileWriter(target);
+		} catch (IOException e) {
+			Console.printerrln(e.getMessage());
+			return;
+		}
+		try {
+			writer.write(content);
+			if (!content.endsWith("</sessions>")) {
+				writer.write("</sessions>");
+			}
+		} catch (IOException e) {
+			Console.printerrln(e.getMessage());
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public void help() {
+		Console.println("Usage: preprocessJFC <sourceFile> <targetFile>");
+	}
+
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/data/JFCEvent.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/data/JFCEvent.java	(revision 305)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/data/JFCEvent.java	(revision 305)
@@ -0,0 +1,172 @@
+package de.ugoe.cs.eventbench.jfc.data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import de.ugoe.cs.eventbench.data.IReplayable;
+import de.ugoe.cs.eventbench.data.ReplayableEvent;
+
+/**
+ * <p>
+ * This class defines JFC events.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class JFCEvent extends ReplayableEvent<IReplayable> {
+
+	/**
+	 * <p>
+	 * Id for object serialization.
+	 * </p>
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * <p>
+	 * Internal map of parameters associated with the event.
+	 * </p>
+	 */
+	private Map<String, String> parameters;
+
+	/**
+	 * <p>
+	 * Information about the event source.
+	 * </p>
+	 */
+	private Map<String, String> sourceParameters;
+
+	/**
+	 * <p>
+	 * Information about the parent of the event source.
+	 * </p>
+	 */
+	private Map<String, String> parentParameters;
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new JFCEvent.
+	 * </p>
+	 * 
+	 * @param type
+	 *            type of the event
+	 */
+	public JFCEvent(String type) {
+		super(type);
+		parameters = new HashMap<String, String>();
+		sourceParameters = new HashMap<String, String>();
+		parentParameters = new HashMap<String, String>();
+	}
+
+	/**
+	 * <p>
+	 * Adds a new parameter to the event.
+	 * </p>
+	 * 
+	 * @param name
+	 *            name of the parameter
+	 * @param value
+	 *            value of the parameter
+	 */
+	public void addParameter(String name, String value) {
+		parameters.put(name, value);
+	}
+
+	/**
+	 * <p>
+	 * Retrieves the value of a parameter.
+	 * </p>
+	 * 
+	 * @param name
+	 *            name of the parameter
+	 * @return value of the parameter
+	 */
+	public String getParameter(String name) {
+		return parameters.get(name);
+	}
+
+	/**
+	 * <p>
+	 * Adds new information about the source of the event.
+	 * </p>
+	 * 
+	 * @param name
+	 *            name of the information
+	 * @param value
+	 *            value of the information
+	 */
+	public void addSourceInformation(String name, String value) {
+		sourceParameters.put(name, value);
+	}
+
+	/**
+	 * <p>
+	 * Retrieves information about the source of the event.
+	 * </p>
+	 * 
+	 * @param name
+	 *            name of the information
+	 * @return value of the information
+	 */
+	public String getSourceInformation(String name) {
+		return sourceParameters.get(name);
+	}
+
+	/**
+	 * <p>
+	 * Adds new information about the parent of the source of the event.
+	 * </p>
+	 * 
+	 * @param name
+	 *            name of the information
+	 * @param value
+	 *            value of the information
+	 */
+	public void addParentInformation(String name, String value) {
+		parentParameters.put(name, value);
+	}
+
+	/**
+	 * <p>
+	 * Retrieves information about the parent of the source of the event.
+	 * </p>
+	 * 
+	 * @param name
+	 *            name of the information
+	 * @return value of the information
+	 */
+	public String getParentInformation(String name) {
+		return parentParameters.get(name);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.eventbench.data.ReplayableEvent#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object other) {
+		if (other == this) {
+			return true;
+		}
+		if (other instanceof JFCEvent) {
+			return super.equals(other)
+					&& parameters.equals(((JFCEvent) other).parameters);
+		}
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.eventbench.data.ReplayableEvent#hashCode()
+	 */
+	@Override
+	public int hashCode() {
+		int hashCode = super.hashCode();
+		hashCode *= parameters.hashCode();
+		return hashCode;
+	}
+
+}
Index: unk/EventBenchConsole/src/de/ugoe/cs/eventbensch/jfc/JFCLogParser.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbensch/jfc/JFCLogParser.java	(revision 304)
+++ 	(revision )
@@ -1,209 +1,0 @@
-package de.ugoe.cs.eventbensch.jfc;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.security.InvalidParameterException;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import de.ugoe.cs.eventbensch.jfc.data.JFCEvent;
-import de.ugoe.cs.util.console.Console;
-
-/**
- * <p>
- * This class provides functionality to parse XML log files generated by the
- * JFCMonitor of EventBench. The result of parsing a file is a collection of
- * event sequences.
- * </p>
- * 
- * @author Steffen Herbold
- * @version 1.0
- */
-public class JFCLogParser extends DefaultHandler {
-
-	/**
-	 * <p>
-	 * Collection of event sequences that is contained in the log file, which is
-	 * parsed.
-	 * </p>
-	 */
-	private Collection<List<JFCEvent>> sequences;
-
-	/**
-	 * <p>
-	 * Internal handle to the event that is currently being parsed.
-	 * </p>
-	 */
-	private JFCEvent currentEvent;
-
-	/**
-	 * <p>
-	 * Internal handle to the event sequence that is currently being parsed.
-	 * </p>
-	 */
-	private List<JFCEvent> currentSequence = null;
-
-	/**
-	 * <p>
-	 * Enumeration to differentiate if a parameter belongs to an event, a source
-	 * or the parent of a source.
-	 * </p>
-	 * 
-	 * @author Steffen Herbold
-	 * @version 1.0
-	 */
-	private enum ParamSource {
-		EVENT, SOURCE, PARENT
-	};
-
-	/**
-	 * <p>
-	 * Specifies whether the parameters that are currently being read belong the
-	 * the event, the source or the parent.
-	 * </p>
-	 */
-	ParamSource paramSource = null;
-
-	/**
-	 * <p>
-	 * Constructor. Creates a new JFCLogParser.
-	 * </p>
-	 */
-	public JFCLogParser() {
-		sequences = new LinkedList<List<JFCEvent>>();
-	}
-
-	/**
-	 * <p>
-	 * Returns the collection of event sequences that is obtained from parsing
-	 * log files.
-	 * </p>
-	 * 
-	 * @return collection of event sequences
-	 */
-	public Collection<List<JFCEvent>> getSequences() {
-		return sequences;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,
-	 * java.lang.String, java.lang.String, org.xml.sax.Attributes)
-	 */
-	public void startElement(String uri, String localName, String qName,
-			Attributes atts) throws SAXException {
-		if (qName.equals("newsession")) {
-			Console.traceln("start of session");
-			if (currentSequence != null && currentSequence.size() != 0) {
-				sequences.add(currentSequence);
-				currentSequence = new LinkedList<JFCEvent>();
-			}
-		} else if (qName.equals("event")) {
-			currentEvent = new JFCEvent(atts.getValue("id"));
-			paramSource = ParamSource.EVENT;
-		} else if (qName.equals("param")) {
-			if (paramSource == ParamSource.EVENT) {
-				currentEvent.addParameter(atts.getValue("name"),
-						atts.getValue("value"));
-			} else if (paramSource == ParamSource.SOURCE) {
-				currentEvent.addSourceInformation(atts.getValue("name"),
-						atts.getValue("value"));
-			} else if (paramSource == ParamSource.PARENT) {
-				currentEvent.addParentInformation(atts.getValue("name"),
-						atts.getValue("value"));
-			}
-		} else if (qName.equals("source")) {
-			paramSource = ParamSource.SOURCE;
-		} else if (qName.equals("parent")) {
-			paramSource = ParamSource.PARENT;
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,
-	 * java.lang.String, java.lang.String)
-	 */
-	@Override
-	public void endElement(String uri, String localName, String qName)
-			throws SAXException {
-		if (qName.equals("event")) {
-			currentSequence.add(currentEvent);
-		} else if (qName.equals("source")) {
-			paramSource = ParamSource.EVENT;
-		} else if (qName.equals("parent")) {
-			paramSource = ParamSource.SOURCE;
-		}
-	}
-
-	/**
-	 * <p>
-	 * Parses a log file written by the JFCMonitor and creates a collection of
-	 * event sequences.
-	 * </p>
-	 * 
-	 * @param filename
-	 *            name and path of the log file
-	 */
-	public void parseFile(String filename) {
-		if (filename == null) {
-			throw new InvalidParameterException("filename must not be null");
-		}
-
-		SAXParserFactory spf = SAXParserFactory.newInstance();
-		spf.setValidating(true);
-
-		SAXParser saxParser = null;
-		InputSource inputSource = null;
-		try {
-			saxParser = spf.newSAXParser();
-			inputSource = new InputSource(new InputStreamReader(
-					new FileInputStream(filename), "UTF-16"));
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-		} catch (ParserConfigurationException e) {
-			e.printStackTrace();
-		} catch (SAXException e) {
-			e.printStackTrace();
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-		}
-		if (inputSource != null) {
-			inputSource.setSystemId("file://"
-					+ new File(filename).getAbsolutePath());
-			try {
-				if (saxParser == null) {
-					throw new RuntimeException("SAXParser creation failed");
-				}
-				saxParser.parse(inputSource, this);
-			} catch (SAXParseException e) {
-				Console.printerrln("Failure parsing file in line "
-						+ e.getLineNumber() + ", column " + e.getColumnNumber()
-						+ ".");
-				e.printStackTrace();
-			} catch (SAXException e) {
-				e.printStackTrace();
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		}
-	}
-
-}
