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

Added comments.

parent a384c0e6
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,9 @@ public class AnalysisControllerBean {
* The logger within this class.
*/
private static final Log LOG = LogFactory.getLog(AnalysisControllerBean.class);
/**
* The controller instance stored within this bean.
*/
private AnalysisController controller;
/**
......@@ -52,21 +55,36 @@ public class AnalysisControllerBean {
* No code necessary.
*/
}
/**
* Delivers the controller stored within this bean.
* @return The current controller in this bean.
*/
public AnalysisController getController() {
return this.controller;
}
/**
* Sets the controller stored within this bean to a new value.
* @param controller The new controller.
*/
public void setController(final AnalysisController controller) {
this.controller = controller;
}
/**
* This method tries to instantiate a new controller using the given project. If the project is null, nothing happens.
* @param mProject The project used to create a new analysis controller.
*/
public void instantiate(final MIProject mProject) {
if (mProject != null) {
try {
/* Create a temporary file and store the model instance in it. */
final File tempFile = File.createTempFile("java", ".tmp");
AnalysisController.saveToFile(tempFile, mProject);
/* Try to create the controller. */
this.controller = new AnalysisController(tempFile);
/* Don't forget to remove the temporary file. */
tempFile.delete();
} catch (final IOException ex) {
AnalysisControllerBean.LOG.error("Could not create analysis controller.", ex);
......
......@@ -41,7 +41,6 @@ import kieker.analysis.model.analysisMetaModel.MIOutputPort;
import kieker.analysis.model.analysisMetaModel.MIPlugin;
import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.analysis.model.analysisMetaModel.MIProperty;
import kieker.analysis.model.analysisMetaModel.MIReader;
import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory;
import kieker.analysis.plugin.AbstractFilterPlugin;
import kieker.analysis.plugin.AbstractPlugin;
......@@ -148,7 +147,7 @@ public class SelectedMainProjectBean {
PluginClassLoader.getInstance().addURL(
new URL(SelectedMainProjectBean.URL_PROTOCOL_FILE, SelectedMainProjectBean.URL_LOCALHOST, FileManager.getInstance().getFullPath(lib)));
} catch (final MalformedURLException ex) {
LOG.warn("Invalid URL for dependency.", ex);
SelectedMainProjectBean.LOG.warn("Invalid URL for dependency.", ex);
}
try {
final List<Class<AbstractPlugin>> plugins = PluginFinder.getAllPluginsWithinJar(new URL(SelectedMainProjectBean.URL_PROTOCOL_FILE,
......@@ -159,7 +158,7 @@ public class SelectedMainProjectBean {
}
}
} catch (final MalformedURLException ex) {
LOG.warn("Invalid URL for dependency.", ex);
SelectedMainProjectBean.LOG.warn("Invalid URL for dependency.", ex);
}
}
}
......@@ -181,7 +180,7 @@ public class SelectedMainProjectBean {
PluginClassLoader.getInstance().addURL(
new URL(SelectedMainProjectBean.URL_PROTOCOL_FILE, SelectedMainProjectBean.URL_LOCALHOST, FileManager.getInstance().getFullPath(lib)));
} catch (final MalformedURLException ex) {
LOG.warn("Invalid URL for dependency.", ex);
SelectedMainProjectBean.LOG.warn("Invalid URL for dependency.", ex);
}
try {
final List<Class<AbstractPlugin>> plugins = PluginFinder.getAllPluginsWithinJar(new URL(SelectedMainProjectBean.URL_PROTOCOL_FILE,
......@@ -192,7 +191,7 @@ public class SelectedMainProjectBean {
}
}
} catch (final MalformedURLException ex) {
LOG.warn("Invalid URL for dependency.", ex);
SelectedMainProjectBean.LOG.warn("Invalid URL for dependency.", ex);
}
}
}
......@@ -215,7 +214,7 @@ public class SelectedMainProjectBean {
PluginClassLoader.getInstance().addURL(
new URL(SelectedMainProjectBean.URL_PROTOCOL_FILE, SelectedMainProjectBean.URL_LOCALHOST, FileManager.getInstance().getFullPath(lib)));
} catch (final MalformedURLException ex) {
LOG.warn("Invalid URL for dependency.", ex);
SelectedMainProjectBean.LOG.warn("Invalid URL for dependency.", ex);
}
try {
final List<Class<AbstractRepository>> repositories = PluginFinder.getAllRepositoriesWithinJar(new URL(SelectedMainProjectBean.URL_PROTOCOL_FILE,
......@@ -226,7 +225,7 @@ public class SelectedMainProjectBean {
}
}
} catch (final MalformedURLException ex) {
LOG.warn("Invalid URL for dependency.", ex);
SelectedMainProjectBean.LOG.warn("Invalid URL for dependency.", ex);
}
}
}
......@@ -277,14 +276,14 @@ public class SelectedMainProjectBean {
final MAnalysisMetaModelFactory factory = new MAnalysisMetaModelFactory();
if (mPlugin instanceof MIAnalysisPlugin) {
for (String inputPortName : inputPortNames) {
for (final String inputPortName : inputPortNames) {
final MIInputPort mInputPort = factory.createInputPort();
mInputPort.setName(inputPortName);
mInputPort.setParent((MIAnalysisPlugin) mPlugin);
}
}
for (String outputPortName : outputPortNames) {
for (final String outputPortName : outputPortNames) {
final MIOutputPort mOutputPort = factory.createOutputPort();
mOutputPort.setName(outputPortName);
mOutputPort.setParent(mPlugin);
......
......@@ -20,7 +20,6 @@
package kieker.webgui.common;
import kieker.analysis.model.analysisMetaModel.MIAnalysisPlugin;
import kieker.analysis.model.analysisMetaModel.MIInputPort;
import kieker.analysis.model.analysisMetaModel.MIOutputPort;
import kieker.analysis.model.analysisMetaModel.MIPlugin;
......
......@@ -20,11 +20,12 @@
package kieker.webgui.converter;
import java.util.concurrent.ConcurrentHashMap;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import kieker.analysis.model.analysisMetaModel.MIPlugin;
import kieker.analysis.model.analysisMetaModel.MIPort;
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment