Skip to content
Snippets Groups Projects
Commit d2c2fce3 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Updated the kieker-jar.

parent b12cbc9f
Branches
Tags
No related merge requests found
No preview for this file type
......@@ -21,11 +21,15 @@ package kieker.webgui.beans.session;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import kieker.analysis.AnalysisController;
import kieker.analysis.exception.AnalysisConfigurationException;
import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.common.logging.Log;
import kieker.common.logging.LogFactory;
......@@ -98,6 +102,8 @@ public class AnalysisControllerBean {
AnalysisControllerBean.LOG.error("Could not create analysis controller.", ex);
} catch (final NullPointerException ex) {
AnalysisControllerBean.LOG.error("Could not create analysis controller.", ex);
} catch (final AnalysisConfigurationException ex) {
AnalysisControllerBean.LOG.error("Could not create analysis controller.", ex);
}
}
}
......@@ -109,7 +115,13 @@ public class AnalysisControllerBean {
final Thread thread = new Thread() {
@Override
public void run() {
try {
AnalysisControllerBean.this.controller.run();
} catch (final IllegalStateException ex) {
AnalysisControllerBean.LOG.error("Could not start the analysis controller.", ex);
} catch (final AnalysisConfigurationException ex) {
AnalysisControllerBean.LOG.error("Could not start the analysis controller.", ex);
}
}
};
thread.start();
......
......@@ -36,8 +36,8 @@ import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import kieker.analysis.model.analysisMetaModel.MIAnalysisPlugin;
import kieker.analysis.model.analysisMetaModel.MIDependency;
import kieker.analysis.model.analysisMetaModel.MIFilter;
import kieker.analysis.model.analysisMetaModel.MIInputPort;
import kieker.analysis.model.analysisMetaModel.MIOutputPort;
import kieker.analysis.model.analysisMetaModel.MIPlugin;
......@@ -57,7 +57,6 @@ import kieker.webgui.common.PluginClassLoader;
import kieker.webgui.common.PluginFinder;
import org.eclipse.emf.common.util.EList;
import org.primefaces.event.DragDropEvent;
/**
* This session bean stores the currently selected main project of the user and provides different methods to access and manipulate the properties of this project.
......@@ -286,11 +285,11 @@ public class SelectedMainProjectBean {
final MAnalysisMetaModelFactory factory = new MAnalysisMetaModelFactory();
if (mPlugin instanceof MIAnalysisPlugin) {
if (mPlugin instanceof MIFilter) {
for (final String inputPortName : inputPortNames) {
final MIInputPort mInputPort = factory.createInputPort();
mInputPort.setName(inputPortName);
mInputPort.setParent((MIAnalysisPlugin) mPlugin);
mInputPort.setParent((MIFilter) mPlugin);
}
}
......@@ -317,7 +316,7 @@ public class SelectedMainProjectBean {
if (AbstractReaderPlugin.class.isAssignableFrom(pluginClass)) {
mPlugin = factory.createReader();
} else {
mPlugin = factory.createAnalysisPlugin();
mPlugin = factory.createFilter();
}
mPlugin.setClassname(pluginClass.getCanonicalName());
......
......@@ -31,6 +31,7 @@ import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import kieker.analysis.AnalysisController;
import kieker.analysis.exception.AnalysisConfigurationException;
import kieker.analysis.model.analysisMetaModel.MIDependency;
import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory;
......@@ -142,10 +143,17 @@ public final class FileManager {
final File fileProject = new File(dirProject, projectName + FileManager.EXTENSION);
try {
final AnalysisController controller = new AnalysisController(project, PluginClassLoader.getInstance());
if (controller.saveToFile(fileProject)) {
try {
controller.saveToFile(fileProject);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "", "Project saved: " + project.getName()));
return true;
} catch (final IOException ex) {
FileManager.LOG.error("Could not save project '" + projectName + "'.", ex);
} catch (final AnalysisConfigurationException ex) {
FileManager.LOG.error("Could not save project '" + projectName + "'.", ex);
}
} catch (final AnalysisConfigurationException ex) {
FileManager.LOG.error("Could not save project '" + projectName + "'.", ex);
} catch (final NullPointerException ex) {
FileManager.LOG.error("Could not save project '" + projectName + "'.", ex);
}
......@@ -205,9 +213,12 @@ public final class FileManager {
/*
* Try to load the project.
*/
final MIProject project = AnalysisController.loadFromFile(projectFile);
if (project != null) {
MIProject project;
try {
project = AnalysisController.loadFromFile(projectFile);
resultList.add(project);
} catch (final IOException ex) {
FileManager.LOG.error("Could not load project.", ex);
}
}
}
......@@ -365,7 +376,11 @@ public final class FileManager {
final File projectFile = new File(FileManager.PROJECT_DIR + File.separator + projectName + File.separator + projectName + FileManager.EXTENSION);
synchronized (this) {
if (projectFile.isFile()) {
try {
return AnalysisController.loadFromFile(projectFile);
} catch (final IOException ex) {
FileManager.LOG.error("Could not load project.", ex);
}
}
}
return null;
......
......@@ -64,7 +64,6 @@
</c:choose>
<p:poll interval="2" update=":analysisForm:analysisStateText :analysisForm:startAnalysisButton :analysisForm:stopAnalysisButton"/>
</h:form>
</p:layoutUnit>
</c:otherwise>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment