diff --git a/.gitignore b/.gitignore index 8f099c2a167543d488bfe008e38589c9250d9654..e6dfcc13c15913f548c089723faba3167b6efd5f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /Kieker.WebGUI/data /Kieker.WebGUI/user /Kieker.WebGUI/derby.log +/Kieker.WebGUI/bin/derby.log +/Kieker.WebGUI/bin/user diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/ComponentListContainer.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/ComponentListContainer.java index c05aa54c3e075bc0003729d70266a1f5c1f6846b..2a3d4ec897891f4a8e4d9eddfc7ba90b9f477e30 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/ComponentListContainer.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/ComponentListContainer.java @@ -17,8 +17,12 @@ package kieker.webgui.domain; import java.util.List; +import kieker.webgui.domain.pluginDecorators.FilterDecorator; +import kieker.webgui.domain.pluginDecorators.ReaderDecorator; +import kieker.webgui.domain.pluginDecorators.RepositoryDecorator; + /** - * This class is a container for multiple {@link PluginContainer} or {@link RepositoryContainer} instances. For each of the component type (reader, filter, + * This class is a container for multiple {@link FilterContainer} or {@link RepositoryContainer} instances. For each of the component type (reader, filter, * repository) there is exactly one list available. This class will mostly be used to deliver a set of available components for a project. A bean using them could * for example copy the available instances. * @@ -26,9 +30,9 @@ import java.util.List; */ public class ComponentListContainer { - private final List<PluginContainer> readers; - private final List<PluginContainer> filters; - private final List<RepositoryContainer> repositories; + private final List<ReaderDecorator> readers; + private final List<FilterDecorator> filters; + private final List<RepositoryDecorator> repositories; /** * Creates a new instance of this class using the given parameters. @@ -40,21 +44,21 @@ public class ComponentListContainer { * @param repositories * The list containing the repositories. */ - public ComponentListContainer(final List<PluginContainer> readers, final List<PluginContainer> filters, final List<RepositoryContainer> repositories) { + public ComponentListContainer(final List<ReaderDecorator> readers, final List<FilterDecorator> filters, final List<RepositoryDecorator> repositories) { this.readers = readers; this.filters = filters; this.repositories = repositories; } - public List<PluginContainer> getReaders() { + public List<ReaderDecorator> getReaders() { return this.readers; } - public List<PluginContainer> getFilters() { + public List<FilterDecorator> getFilters() { return this.filters; } - public List<RepositoryContainer> getRepositories() { + public List<RepositoryDecorator> getRepositories() { return this.repositories; } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/PluginContainer.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/PluginContainer.java deleted file mode 100644 index 4ed90682a15c5a772a5dad4ec7bf30dad86e493e..0000000000000000000000000000000000000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/PluginContainer.java +++ /dev/null @@ -1,184 +0,0 @@ -/*************************************************************************** - * Copyright 2013 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package kieker.webgui.domain; - -import java.util.Map; - -import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; -import kieker.analysis.model.analysisMetaModel.MIDisplay; -import kieker.analysis.model.analysisMetaModel.MIFilter; -import kieker.analysis.model.analysisMetaModel.MIInputPort; -import kieker.analysis.model.analysisMetaModel.MIOutputPort; -import kieker.analysis.model.analysisMetaModel.MIPlugin; -import kieker.analysis.model.analysisMetaModel.MIProperty; -import kieker.analysis.model.analysisMetaModel.MIReader; -import kieker.analysis.model.analysisMetaModel.MIRepositoryConnector; - -/** - * This is a container to wrap a single instance of {@link MIPlugin} together with different meta information. - * - * @author Nils Christian Ehmke - */ -public class PluginContainer implements IComponentContainer { - - private final Map<String, String> propertyDescriptions; - private final Map<String, String> displayDescriptions; - private final boolean fullyInitialized; - private final MIPlugin plugin; - private final String description; - private final String dependency; - - /** - * Creates a new instance of this class using the given parameters. - * - * @param plugin - * The plugin to be stored in this container. - * @param description - * The description of the plugin. - * @param dependency - * The dependency description of the plugin. - * @param fullyInitialized - * A flag to determine whether the plugin has been initialized fully or whether there was an error during the class loading. - * @param propertyDescriptions - * A map containing the descriptions of the properties of the plugin. - * @param displayDescriptions - * A map containing the display descriptions of the properties of the plugin. - */ - public PluginContainer(final MIPlugin plugin, final String description, final String dependency, final boolean fullyInitialized, - final Map<String, String> propertyDescriptions, final Map<String, String> displayDescriptions) { - this.plugin = plugin; - this.description = description; - this.dependency = dependency; - this.fullyInitialized = fullyInitialized; - this.propertyDescriptions = propertyDescriptions; - this.displayDescriptions = displayDescriptions; - } - - public String getDescription() { - return this.description; - } - - public String getDependency() { - return this.dependency; - } - - public boolean isFullyInitialized() { - return this.fullyInitialized; - } - - public boolean isReader() { - return this.plugin instanceof MIReader; - } - - public boolean isFilter() { - return this.plugin instanceof MIFilter; - } - - /** - * Delivers the description of the given display. - * - * @param display - * The name of the display. - * @return The human readable description of the given display. - */ - public String getDisplayDescription(final String display) { - return this.displayDescriptions.get(display); - } - - /** - * {@inheritDoc} - */ - @Override - public String getPropertyDescription(final String property) { - return this.propertyDescriptions.get(property); - } - - /** - * Getter for the property {@link PluginContainer#plugin}. <b>DO NOT MODIFIY THIS OBJECT!</b> Use {@link PluginContainer#newInstance(MIAnalysisMetaModelFactory)} - * instead to get a copy. - * - * @return The current value of the property. - */ - public MIPlugin getPlugin() { - return this.plugin; - } - - /** - * Delivers a copy of the plugin instance within this container. - * - * @param factory - * The factory to be used to create the copy. - * @return A deep copy of the plugin. - */ - public MIPlugin newInstance(final MIAnalysisMetaModelFactory factory) { - final MIPlugin pluginCopy; - - if (this.plugin instanceof MIReader) { - pluginCopy = factory.createReader(); - } else if (this.plugin instanceof MIFilter) { - pluginCopy = factory.createFilter(); - // Copy the input ports of the plugin instance - for (final MIInputPort inputPort : ((MIFilter) this.plugin).getInputPorts()) { - final MIInputPort inputPortCopy = factory.createInputPort(); - inputPortCopy.setName(inputPort.getName()); - inputPortCopy.setParent((MIFilter) pluginCopy); - ((MIFilter) pluginCopy).getInputPorts().add(inputPortCopy); - } - } else { - // This should not happen - return null; - } - - // Copy the output ports of the plugin instance - for (final MIOutputPort outputPort : this.plugin.getOutputPorts()) { - final MIOutputPort outputPortCopy = factory.createOutputPort(); - outputPortCopy.setName(outputPort.getName()); - outputPortCopy.setParent(pluginCopy); - pluginCopy.getOutputPorts().add(outputPortCopy); - } - - // Copy the repository "ports" - for (final MIRepositoryConnector repositoryConnector : this.plugin.getRepositories()) { - final MIRepositoryConnector repositoryConnectorCopy = factory.createRepositoryConnector(); - repositoryConnectorCopy.setName(repositoryConnector.getName()); - pluginCopy.getRepositories().add(repositoryConnectorCopy); - } - - // Copy the displays - for (final MIDisplay display : this.plugin.getDisplays()) { - final MIDisplay displayCopy = factory.createDisplay(); - displayCopy.setName(display.getName()); - displayCopy.setParent(pluginCopy); - pluginCopy.getDisplays().add(displayCopy); - } - - // Copy the properties - for (final MIProperty property : this.plugin.getProperties()) { - final MIProperty propertyCopy = factory.createProperty(); - propertyCopy.setName(property.getName()); - propertyCopy.setValue(property.getValue()); - pluginCopy.getProperties().add(propertyCopy); - } - - // Copy the remaining attributes - pluginCopy.setClassname(this.plugin.getClassname()); - pluginCopy.setName(this.plugin.getName()); - - return pluginCopy; - } - -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/RepositoryContainer.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/RepositoryContainer.java deleted file mode 100644 index 524aa00c8a6d1988c98f2ae9206ea2a32a0cc1eb..0000000000000000000000000000000000000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/RepositoryContainer.java +++ /dev/null @@ -1,120 +0,0 @@ -/*************************************************************************** - * Copyright 2013 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package kieker.webgui.domain; - -import java.util.Map; - -import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; -import kieker.analysis.model.analysisMetaModel.MIProperty; -import kieker.analysis.model.analysisMetaModel.MIRepository; - -/** - * This is a container to wrap a single instance of {@link MIRepository} together with different meta information. - * - * @author Nils Christian Ehmke - */ -public class RepositoryContainer implements IComponentContainer { - - private final Map<String, String> propertyDescriptions; - private final boolean fullyInitialized; - private final MIRepository repository; - private final String description; - private final String dependency; - - /** - * Creates a new instance of this class using the given parameters. - * - * @param repository - * The repository to be stored in this container. - * @param description - * The description of the repository. - * @param dependency - * The dependency description of the repository. - * @param fullyInitialized - * A flag to determine whether the repository has been initialized fully or whether there was an error during the class loading. - * @param propertyDescriptions - * A map containing the descriptions of the properties of the repository. - */ - public RepositoryContainer(final MIRepository repository, final String description, final String dependency, final boolean fullyInitialized, - final Map<String, String> propertyDescriptions) { - this.repository = repository; - this.description = description; - this.dependency = dependency; - this.fullyInitialized = fullyInitialized; - this.propertyDescriptions = propertyDescriptions; - } - - public String getDescription() { - return this.description; - } - - public String getDependency() { - return this.dependency; - } - - public boolean isFullyInitialized() { - return this.fullyInitialized; - } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.common.IComponentContainer#getPropertyDescription(java.lang.String) - */ - @Override - public String getPropertyDescription(final String property) { - return this.propertyDescriptions.get(property); - } - - /** - * Getter for the property {@link RepositoryContainer#repository}. <b>DO NOT MODIFIY THIS OBJECT!</b> Use - * {@link RepositoryContainer#newInstance(MIAnalysisMetaModelFactory)} instead to get a copy. - * - * @return The current value of the property. - */ - public MIRepository getRepository() { - return this.repository; - } - - /** - * Delivers a copy of the repository instance within this container. - * - * @param factory - * The factory to be used to create the copy. - * @return A deep copy of the repository. - */ - public MIRepository newInstance(final MIAnalysisMetaModelFactory factory) { - final MIRepository repositoryCopy; - - repositoryCopy = factory.createRepository(); - - // Copy the properties - for (final MIProperty property : this.repository.getProperties()) { - final MIProperty propertyCopy = factory.createProperty(); - propertyCopy.setName(property.getName()); - propertyCopy.setValue(property.getValue()); - repositoryCopy.getProperties().add(propertyCopy); - } - - // Copy the remaining attributes - repositoryCopy.setClassname(this.repository.getClassname()); - repositoryCopy.setName(this.repository.getName()); - - return repositoryCopy; - } - -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/AbstractAnalysisComponentDecorator.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/AbstractAnalysisComponentDecorator.java new file mode 100644 index 0000000000000000000000000000000000000000..db7bd3e0efc3733f1ca7ae27028cafa033af49d8 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/AbstractAnalysisComponentDecorator.java @@ -0,0 +1,214 @@ +/*************************************************************************** + * Copyright 2013 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.webgui.domain.pluginDecorators; + +import java.lang.reflect.InvocationTargetException; +import java.util.Map; + +import kieker.analysis.model.analysisMetaModel.MIAnalysisComponent; +import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; +import kieker.analysis.model.analysisMetaModel.MIProperty; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.resource.Resource; + +public abstract class AbstractAnalysisComponentDecorator<T extends MIAnalysisComponent> implements MIAnalysisComponent { + + protected final T analysisComponent; + + private final Map<String, String> propertiesDescriptions; + private final String description; + private final String dependency; + private final boolean fullyInitialized; + + public AbstractAnalysisComponentDecorator(final T analysisComponent, final Map<String, String> propertiesDescriptions, final String description, + final String dependency, final boolean fullyInitialized) { + this.analysisComponent = analysisComponent; + this.propertiesDescriptions = propertiesDescriptions; + this.description = description; + this.dependency = dependency; + this.fullyInitialized = fullyInitialized; + } + + @Override + public final TreeIterator<EObject> eAllContents() { + return this.analysisComponent.eAllContents(); + } + + @Override + public final EClass eClass() { + return this.analysisComponent.eClass(); + } + + @Override + public final EObject eContainer() { + return this.analysisComponent.eContainer(); + } + + @Override + public final EStructuralFeature eContainingFeature() { + return this.analysisComponent.eContainingFeature(); + } + + @Override + public final EReference eContainmentFeature() { + return this.analysisComponent.eContainmentFeature(); + } + + @Override + public final EList<EObject> eContents() { + return this.analysisComponent.eContents(); + } + + @Override + public final EList<EObject> eCrossReferences() { + return this.analysisComponent.eCrossReferences(); + } + + @Override + public final Object eGet(final EStructuralFeature arg0) { + return this.analysisComponent.eGet(arg0); + } + + @Override + public final Object eGet(final EStructuralFeature arg0, final boolean arg1) { + return this.analysisComponent.eGet(arg0, arg1); + } + + @Override + public final Object eInvoke(final EOperation arg0, final EList<?> arg1) throws InvocationTargetException { + return this.analysisComponent.eInvoke(arg0, arg1); + } + + @Override + public final boolean eIsProxy() { + return this.analysisComponent.eIsProxy(); + } + + @Override + public final boolean eIsSet(final EStructuralFeature arg0) { + return this.analysisComponent.eIsSet(arg0); + } + + @Override + public final Resource eResource() { + return this.analysisComponent.eResource(); + } + + @Override + public final void eSet(final EStructuralFeature arg0, final Object arg1) { + this.analysisComponent.eSet(arg0, arg1); + } + + @Override + public final void eUnset(final EStructuralFeature arg0) { + this.analysisComponent.eUnset(arg0); + } + + @Override + public final EList<Adapter> eAdapters() { + return this.analysisComponent.eAdapters(); + } + + @Override + public final boolean eDeliver() { + return this.analysisComponent.eDeliver(); + } + + @Override + public final void eNotify(final Notification arg0) { + this.analysisComponent.eNotify(arg0); + } + + @Override + public final void eSetDeliver(final boolean arg0) { + this.analysisComponent.eSetDeliver(arg0); + } + + @Override + public final String getName() { + return this.analysisComponent.getName(); + } + + @Override + public final void setName(final String value) { + this.analysisComponent.setName(value); + } + + @Override + public final String getClassname() { + return this.analysisComponent.getClassname(); + } + + @Override + public final void setClassname(final String value) { + this.analysisComponent.setClassname(value); + } + + @Override + public final EList<MIProperty> getProperties() { + return this.analysisComponent.getProperties(); + } + + public final String getDescription() { + return this.description; + } + + public final String getDependency() { + return this.dependency; + } + + public final boolean isFullyInitialized() { + return this.fullyInitialized; + } + + public final String getPropertyDescription(final String property) { + return this.propertiesDescriptions.get(property); + } + + public final T newCopy(final MIAnalysisMetaModelFactory factory) { + final T componentCopy = this.createComponent(factory); + + this.refineComponentCopy(factory, componentCopy); + + return componentCopy; + } + + protected abstract T createComponent(final MIAnalysisMetaModelFactory factory); + + protected void refineComponentCopy(final MIAnalysisMetaModelFactory factory, final T componentCopy) { + // Copy the properties + for (final MIProperty property : this.analysisComponent.getProperties()) { + final MIProperty propertyCopy = factory.createProperty(); + propertyCopy.setName(property.getName()); + propertyCopy.setValue(property.getValue()); + componentCopy.getProperties().add(propertyCopy); + } + + // Copy the remaining attributes + componentCopy.setClassname(this.analysisComponent.getClassname()); + componentCopy.setName(this.analysisComponent.getName()); + } +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/AbstractPluginDecorator.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/AbstractPluginDecorator.java new file mode 100644 index 0000000000000000000000000000000000000000..aae304fc6e6cd44d70f2bc9ef9e0de1a519603d1 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/AbstractPluginDecorator.java @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright 2013 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.webgui.domain.pluginDecorators; + +import java.util.Map; + +import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; +import kieker.analysis.model.analysisMetaModel.MIDisplay; +import kieker.analysis.model.analysisMetaModel.MIOutputPort; +import kieker.analysis.model.analysisMetaModel.MIPlugin; +import kieker.analysis.model.analysisMetaModel.MIRepositoryConnector; + +import org.eclipse.emf.common.util.EList; + +public abstract class AbstractPluginDecorator<T extends MIPlugin> extends AbstractAnalysisComponentDecorator<T> implements MIPlugin { + + private final Map<String, String> displaysDescriptions; + + public AbstractPluginDecorator(final T analysisComponent, final Map<String, String> propertiesDescriptions, final String description, final String dependency, + final boolean fullyInitialized, final Map<String, String> displaysDescriptions) { + super(analysisComponent, propertiesDescriptions, description, dependency, fullyInitialized); + + this.displaysDescriptions = displaysDescriptions; + } + + @Override + public final EList<MIRepositoryConnector> getRepositories() { + return super.analysisComponent.getRepositories(); + } + + @Override + public final EList<MIOutputPort> getOutputPorts() { + return super.analysisComponent.getOutputPorts(); + } + + @Override + public final EList<MIDisplay> getDisplays() { + return super.analysisComponent.getDisplays(); + } + + public final String getDisplayDescription(final String display) { + return this.displaysDescriptions.get(display); + } + + @Override + protected void refineComponentCopy(final MIAnalysisMetaModelFactory factory, final T componentCopy) { + super.refineComponentCopy(factory, componentCopy); + + // Copy the output ports of the plugin instance + for (final MIOutputPort outputPort : super.analysisComponent.getOutputPorts()) { + final MIOutputPort outputPortCopy = factory.createOutputPort(); + outputPortCopy.setName(outputPort.getName()); + outputPortCopy.setParent(componentCopy); + componentCopy.getOutputPorts().add(outputPortCopy); + } + + // Copy the repository "ports" + for (final MIRepositoryConnector repositoryConnector : super.analysisComponent.getRepositories()) { + final MIRepositoryConnector repositoryConnectorCopy = factory.createRepositoryConnector(); + repositoryConnectorCopy.setName(repositoryConnector.getName()); + componentCopy.getRepositories().add(repositoryConnectorCopy); + } + + // Copy the displays + for (final MIDisplay display : super.analysisComponent.getDisplays()) { + final MIDisplay displayCopy = factory.createDisplay(); + displayCopy.setName(display.getName()); + displayCopy.setParent(componentCopy); + componentCopy.getDisplays().add(displayCopy); + } + } + +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/FilterDecorator.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/FilterDecorator.java new file mode 100644 index 0000000000000000000000000000000000000000..7af6df30c1063e4397e990a5e8f9fc7d1541c7c4 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/FilterDecorator.java @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright 2013 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.webgui.domain.pluginDecorators; + +import java.util.Map; + +import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; +import kieker.analysis.model.analysisMetaModel.MIFilter; +import kieker.analysis.model.analysisMetaModel.MIInputPort; + +import org.eclipse.emf.common.util.EList; + +public class FilterDecorator extends AbstractPluginDecorator<MIFilter> implements MIFilter { + + public FilterDecorator(final MIFilter analysisComponent, final Map<String, String> propertiesDescriptions, final String description, final String dependency, + final boolean fullyInitialized, final Map<String, String> displaysDescriptions) { + super(analysisComponent, propertiesDescriptions, description, dependency, fullyInitialized, displaysDescriptions); + } + + @Override + public final EList<MIInputPort> getInputPorts() { + return super.analysisComponent.getInputPorts(); + } + + @Override + protected final MIFilter createComponent(final MIAnalysisMetaModelFactory factory) { + return factory.createFilter(); + } + + @Override + protected void refineComponentCopy(final MIAnalysisMetaModelFactory factory, final MIFilter componentCopy) { + super.refineComponentCopy(factory, componentCopy); + + // Copy the input ports of the plugin instance + for (final MIInputPort inputPort : super.analysisComponent.getInputPorts()) { + final MIInputPort inputPortCopy = factory.createInputPort(); + inputPortCopy.setName(inputPort.getName()); + inputPortCopy.setParent(componentCopy); + componentCopy.getInputPorts().add(inputPortCopy); + } + } + +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/ReaderDecorator.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/ReaderDecorator.java new file mode 100644 index 0000000000000000000000000000000000000000..c6ca60babfd8509fde97416c49eaf6b3c80bfec3 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/ReaderDecorator.java @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright 2013 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.webgui.domain.pluginDecorators; + +import java.util.Map; + +import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; +import kieker.analysis.model.analysisMetaModel.MIReader; + +public class ReaderDecorator extends AbstractPluginDecorator<MIReader> implements MIReader { + + public ReaderDecorator(final MIReader analysisComponent, final Map<String, String> propertiesDescriptions, final String description, final String dependency, + final boolean fullyInitialized, final Map<String, String> displaysDescriptions) { + super(analysisComponent, propertiesDescriptions, description, dependency, fullyInitialized, displaysDescriptions); + } + + @Override + protected final MIReader createComponent(final MIAnalysisMetaModelFactory factory) { + return factory.createReader(); + } + +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/IComponentContainer.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/RepositoryDecorator.java similarity index 50% rename from Kieker.WebGUI/src/main/java/kieker/webgui/domain/IComponentContainer.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/RepositoryDecorator.java index 797ea54357f8a48b59a655151b6ef4f3b301874c..9f351b8336d921451086a952a4e7e374a92fe9b4 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/IComponentContainer.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/pluginDecorators/RepositoryDecorator.java @@ -13,22 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package kieker.webgui.domain; -/** - * This is the interface for component containers of different types (plugins and repositories). It exists to have a common base for the implementing classes. - * - * @author Nils Christian Ehmke - */ -public interface IComponentContainer { +package kieker.webgui.domain.pluginDecorators; - /** - * Delivers the description of the given property. - * - * @param property - * The property name. - * @return The human readable description of the property. - */ - public String getPropertyDescription(final String property); +import java.util.Map; + +import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; +import kieker.analysis.model.analysisMetaModel.MIRepository; + +public class RepositoryDecorator extends AbstractAnalysisComponentDecorator<MIRepository> implements MIRepository { + + public RepositoryDecorator(final MIRepository analysisComponent, final Map<String, String> propertiesDescriptions, final String description, + final String dependency, + final boolean fullyInitialized) { + super(analysisComponent, propertiesDescriptions, description, dependency, fullyInitialized); + } + + @Override + protected final MIRepository createComponent(final MIAnalysisMetaModelFactory factory) { + return factory.createRepository(); + } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java index 97f634a599c1a2b25acd289e67ba61d122cf14ce..831ec8be711deadcffa2fd3b8a6061db629efd72 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java @@ -21,8 +21,6 @@ import java.io.IOException; import java.util.Collection; import java.util.List; -import org.springframework.security.access.prepost.PreAuthorize; - import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.webgui.common.ClassAndMethodContainer; import kieker.webgui.common.exception.NewerProjectException; @@ -32,6 +30,8 @@ import kieker.webgui.domain.ComponentListContainer; import org.primefaces.model.UploadedFile; +import org.springframework.security.access.prepost.PreAuthorize; + /** * This is the interface for the data access object(s) which will access for example the file system to manage the available projects. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java index a3af141975dd800b3cbfc7982d8ad8e6073dd491..de790f129402c344081022565cf0b7870409f170 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java @@ -18,11 +18,11 @@ package kieker.webgui.persistence; import java.util.List; -import org.springframework.security.access.prepost.PreAuthorize; - import kieker.webgui.common.exception.DataAccessException; import kieker.webgui.domain.User; +import org.springframework.security.access.prepost.PreAuthorize; + /** * This is the interface for the data access object(s) which will access for example a database to manage the available users. The methods within this interface are * only accessible by administrators. Furthermore the methods should be transactional. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java index a8b165e3cfd475eb6a85468a0d69a0d8d77591c9..eb041455b39e3097e946f0cf12eed19d6296249d 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java @@ -25,10 +25,6 @@ import java.util.List; import javax.sql.DataSource; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.datasource.DataSourceUtils; -import org.springframework.stereotype.Service; - import kieker.common.logging.Log; import kieker.common.logging.LogFactory; import kieker.webgui.common.exception.DataAccessException; @@ -36,6 +32,10 @@ import kieker.webgui.domain.User; import kieker.webgui.domain.User.Role; import kieker.webgui.persistence.IUserDAO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.datasource.DataSourceUtils; +import org.springframework.stereotype.Service; + /** * An implementation of the {@link IUserDAO} interface, which uses Apache Derby to store and manage the available users. A transaction manager is not necessary, as * all of the used commands are atomic (except for the getUsers() method, which is read only though). diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java index 0bfe99b5c7b44a59bda883b55d5782cc0ffaf278..433753eef018e913303e4ca1b2aa4d1667828893 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java @@ -40,14 +40,6 @@ import java.util.concurrent.ConcurrentHashMap; import javax.annotation.PostConstruct; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.stereotype.Service; -import org.springframework.util.FileCopyUtils; -import org.springframework.util.FileSystemUtils; -import org.springframework.util.WeakReferenceMonitor; -import org.springframework.util.WeakReferenceMonitor.ReleaseListener; - import com.google.common.io.Files; import kieker.analysis.AnalysisController; @@ -63,8 +55,9 @@ import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectAlreadyExistingException; import kieker.webgui.common.exception.ProjectNotExistingException; import kieker.webgui.domain.ComponentListContainer; -import kieker.webgui.domain.PluginContainer; -import kieker.webgui.domain.RepositoryContainer; +import kieker.webgui.domain.pluginDecorators.FilterDecorator; +import kieker.webgui.domain.pluginDecorators.ReaderDecorator; +import kieker.webgui.domain.pluginDecorators.RepositoryDecorator; import kieker.webgui.persistence.IProjectDAO; import kieker.webgui.persistence.impl.util.Class2ModelInstanceConverter; import kieker.webgui.persistence.impl.util.CloseableURLClassLoader; @@ -72,6 +65,14 @@ import kieker.webgui.persistence.impl.util.PluginFinder; import org.primefaces.model.UploadedFile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Service; +import org.springframework.util.FileCopyUtils; +import org.springframework.util.FileSystemUtils; +import org.springframework.util.WeakReferenceMonitor; +import org.springframework.util.WeakReferenceMonitor.ReleaseListener; + /** * This is an implementation of the {@link IProjectDAO} interface, which uses the file system to store the available projects and everything. * @@ -137,9 +138,9 @@ public class FSProjectDAOImpl implements IProjectDAO, ReleaseListener { final CloseableURLClassLoader classLoader = (CloseableURLClassLoader) this.getClassLoader(project, dummyObject); // NOPMD (No ordinary classloader) final ClassAndMethodContainer classAndMethodContainer = new ClassAndMethodContainer(classLoader); - final List<PluginContainer> readers = new ArrayList<PluginContainer>(); - final List<PluginContainer> filters = new ArrayList<PluginContainer>(); - final List<RepositoryContainer> repositories = new ArrayList<RepositoryContainer>(); + final List<ReaderDecorator> readers = new ArrayList<ReaderDecorator>(); + final List<FilterDecorator> filters = new ArrayList<FilterDecorator>(); + final List<RepositoryDecorator> repositories = new ArrayList<RepositoryDecorator>(); // Update the components using all available dependencies final Collection<String> libs = this.listAllLibraries(project); @@ -161,8 +162,8 @@ public class FSProjectDAOImpl implements IProjectDAO, ReleaseListener { } } - private void initializeAvailableComponentsLists(final List<PluginContainer> readers, final List<PluginContainer> filters, - final List<RepositoryContainer> repositories, final URL lib, final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) + private void initializeAvailableComponentsLists(final List<ReaderDecorator> readers, final List<FilterDecorator> filters, + final List<RepositoryDecorator> repositories, final URL lib, final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) throws IOException { // FInd the available classes within the library final List<Class<AbstractRepository>> repositoryClasses = this.pluginFinder.getAllRepositoriesWithinJar(lib, classLoader, classAndMethodContainer); @@ -179,14 +180,12 @@ public class FSProjectDAOImpl implements IProjectDAO, ReleaseListener { // Convert the plugins into model instances for (final Class<AbstractReaderPlugin> reader : readerClasses) { if (!(Modifier.isAbstract(reader.getModifiers()) || this.class2ModelInstanceConverter.isProgrammaticOnly(reader, classAndMethodContainer))) { - final PluginContainer pluginContainer = this.class2ModelInstanceConverter.convertReaderClass2ModelInstance(reader, classAndMethodContainer); - readers.add(pluginContainer); + readers.add(this.class2ModelInstanceConverter.convertReaderClass2ModelInstance(reader, classAndMethodContainer)); } } for (final Class<AbstractFilterPlugin> filter : filterClasses) { if (!(Modifier.isAbstract(filter.getModifiers()) || this.class2ModelInstanceConverter.isProgrammaticOnly(filter, classAndMethodContainer))) { - final PluginContainer pluginContainer = this.class2ModelInstanceConverter.convertFilterClass2ModelInstance(filter, classAndMethodContainer); - readers.add(pluginContainer); + filters.add(this.class2ModelInstanceConverter.convertFilterClass2ModelInstance(filter, classAndMethodContainer)); } } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/Class2ModelInstanceConverter.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/Class2ModelInstanceConverter.java index e0d1b9b81f00c3889edb7750834ab05044aeb311..0a854cfb36cccfdcde91c154008f7c204edbc510 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/Class2ModelInstanceConverter.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/Class2ModelInstanceConverter.java @@ -32,6 +32,7 @@ import kieker.analysis.model.analysisMetaModel.MIInputPort; import kieker.analysis.model.analysisMetaModel.MIOutputPort; import kieker.analysis.model.analysisMetaModel.MIPlugin; import kieker.analysis.model.analysisMetaModel.MIProperty; +import kieker.analysis.model.analysisMetaModel.MIReader; import kieker.analysis.model.analysisMetaModel.MIRepository; import kieker.analysis.plugin.AbstractPlugin; import kieker.analysis.plugin.filter.AbstractFilterPlugin; @@ -40,9 +41,10 @@ import kieker.analysis.repository.AbstractRepository; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; import kieker.webgui.common.ClassAndMethodContainer; -import kieker.webgui.domain.IComponentContainer; -import kieker.webgui.domain.PluginContainer; -import kieker.webgui.domain.RepositoryContainer; +import kieker.webgui.domain.pluginDecorators.AbstractAnalysisComponentDecorator; +import kieker.webgui.domain.pluginDecorators.FilterDecorator; +import kieker.webgui.domain.pluginDecorators.ReaderDecorator; +import kieker.webgui.domain.pluginDecorators.RepositoryDecorator; import net.vidageek.mirror.dsl.Mirror; @@ -68,20 +70,21 @@ public class Class2ModelInstanceConverter { // No code necessary } - public PluginContainer convertReaderClass2ModelInstance(final Class<AbstractReaderPlugin> clazz, final ClassAndMethodContainer classAndMethodContainer) { - return (PluginContainer) this.convertComponentClass2ModelInstance(clazz, classAndMethodContainer, Type.Reader); + public ReaderDecorator convertReaderClass2ModelInstance(final Class<AbstractReaderPlugin> clazz, final ClassAndMethodContainer classAndMethodContainer) { + return (ReaderDecorator) this.convertComponentClass2ModelInstance(clazz, classAndMethodContainer, Type.Reader); } - public PluginContainer convertFilterClass2ModelInstance(final Class<AbstractFilterPlugin> clazz, final ClassAndMethodContainer classAndMethodContainer) { - return (PluginContainer) this.convertComponentClass2ModelInstance(clazz, classAndMethodContainer, Type.Filter); + public FilterDecorator convertFilterClass2ModelInstance(final Class<AbstractFilterPlugin> clazz, final ClassAndMethodContainer classAndMethodContainer) { + return (FilterDecorator) this.convertComponentClass2ModelInstance(clazz, classAndMethodContainer, Type.Filter); } - public RepositoryContainer convertRepositoryClass2ModelInstance(final Class<AbstractRepository> clazz, final ClassAndMethodContainer classAndMethodContainer) { - return (RepositoryContainer) this.convertComponentClass2ModelInstance(clazz, classAndMethodContainer, Type.Repository); + public RepositoryDecorator convertRepositoryClass2ModelInstance(final Class<AbstractRepository> clazz, final ClassAndMethodContainer classAndMethodContainer) { + return (RepositoryDecorator) this.convertComponentClass2ModelInstance(clazz, classAndMethodContainer, Type.Repository); } @SuppressWarnings("unchecked") - private IComponentContainer convertComponentClass2ModelInstance(final Class<? extends AbstractAnalysisComponent> clazz, + private AbstractAnalysisComponentDecorator<? extends MIAnalysisComponent> convertComponentClass2ModelInstance( + final Class<? extends AbstractAnalysisComponent> clazz, final ClassAndMethodContainer classAndMethodContainer, final Type type) { final MIAnalysisComponent plugin = this.createSuitableModelInstance(clazz, classAndMethodContainer); @@ -91,37 +94,59 @@ public class Class2ModelInstanceConverter { final Collection<MIDisplay> displays = new ArrayList<MIDisplay>(); final Map<String, String> propertyDescriptions = new HashMap<String, String>(); final Map<String, String> displayDescriptions = new HashMap<String, String>(); - String description; - String dependency; - - this.fillProperties(clazz, classAndMethodContainer, properties, propertyDescriptions); - if ((type == Type.Filter) || (type == Type.Reader)) { - this.fillOutputPorts((Class<AbstractPlugin>) clazz, classAndMethodContainer, outputPorts, (MIPlugin) plugin); - this.fillDisplays((Class<AbstractPlugin>) clazz, classAndMethodContainer, displays, displayDescriptions); - if (type == Type.Filter) { - this.fillInputPorts((Class<AbstractFilterPlugin>) clazz, classAndMethodContainer, inputPorts, (MIFilter) plugin); + String description = ""; + String dependency = ""; + boolean fullyInitialized = true; + + try { + description = this.fillDescription(clazz, classAndMethodContainer); + dependency = this.fillDependency(clazz, classAndMethodContainer); + + this.fillProperties(clazz, classAndMethodContainer, properties, propertyDescriptions); + plugin.getProperties().addAll(properties); + if ((type == Type.Filter) || (type == Type.Reader)) { + this.fillOutputPorts((Class<AbstractPlugin>) clazz, classAndMethodContainer, outputPorts, (MIPlugin) plugin); + this.fillDisplays((Class<AbstractPlugin>) clazz, classAndMethodContainer, displays, displayDescriptions); + ((MIPlugin) plugin).getOutputPorts().addAll(outputPorts); + ((MIPlugin) plugin).getDisplays().addAll(displays); + if (type == Type.Filter) { + this.fillInputPorts((Class<AbstractFilterPlugin>) clazz, classAndMethodContainer, inputPorts, (MIFilter) plugin); + ((MIFilter) plugin).getInputPorts().addAll(inputPorts); + } } - } - description = this.fillDescription(clazz, classAndMethodContainer); - dependency = this.fillDependency(clazz, classAndMethodContainer); - - plugin.getProperties().addAll(properties); - if ((type == Type.Filter) || (type == Type.Reader)) { - ((MIPlugin) plugin).getOutputPorts().addAll(outputPorts); - ((MIPlugin) plugin).getDisplays().addAll(displays); - if (type == Type.Filter) { - ((MIFilter) plugin).getDisplays().addAll(displays); + } catch (final Throwable ex) { // NOCS (Throwable) + Class2ModelInstanceConverter.LOG.info("A component with the classname '" + clazz.getCanonicalName() + "' could not be initialized.", ex); + + plugin.getProperties().clear(); + if ((type == Type.Filter) || (type == Type.Reader)) { + ((MIPlugin) plugin).getOutputPorts().clear(); + ((MIPlugin) plugin).getDisplays().clear(); + if (type == Type.Filter) { + ((MIFilter) plugin).getDisplays().clear(); + } } + + fullyInitialized = false; } plugin.setClassname(clazz.getName()); plugin.setName(clazz.getSimpleName()); - if (type == Type.Repository) { - return new RepositoryContainer((MIRepository) plugin, description, dependency, true, Collections.unmodifiableMap(propertyDescriptions)); - } else { - return new PluginContainer((MIPlugin) plugin, description, dependency, true, Collections.unmodifiableMap(propertyDescriptions), + switch (type) { + case Filter: { + return new FilterDecorator((MIFilter) plugin, Collections.unmodifiableMap(propertyDescriptions), description, dependency, fullyInitialized, + Collections.unmodifiableMap(displayDescriptions)); + } + case Reader: { + return new ReaderDecorator((MIReader) plugin, Collections.unmodifiableMap(propertyDescriptions), description, dependency, fullyInitialized, Collections.unmodifiableMap(displayDescriptions)); } + case Repository: { + return new RepositoryDecorator((MIRepository) plugin, Collections.unmodifiableMap(propertyDescriptions), description, dependency, fullyInitialized); + + } + default: + return null; + } } private void fillInputPorts(final Class<AbstractFilterPlugin> clazz, final ClassAndMethodContainer classAndMethodContainer, diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/PluginFinder.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/PluginFinder.java index 85f21c8325ea85322d177373b836fb0c4279055d..8421655c4ea19a69135b0674e5962c44d802cb80 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/PluginFinder.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/util/PluginFinder.java @@ -22,13 +22,13 @@ import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; -import org.springframework.stereotype.Service; - import kieker.analysis.plugin.filter.AbstractFilterPlugin; import kieker.analysis.plugin.reader.AbstractReaderPlugin; import kieker.analysis.repository.AbstractRepository; import kieker.webgui.common.ClassAndMethodContainer; +import org.springframework.stereotype.Service; + /** * This tool class can be used to find all plugins and repositories within a given jar file - assuming that the given class loader knows these jars. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IGraphLayoutService.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IGraphLayoutService.java index 84e6fe95d2bda71f041feda50a0a7f828206f5e8..321fc3665f04b2681ecdef737dc1d75808f74be2 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IGraphLayoutService.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IGraphLayoutService.java @@ -16,10 +16,10 @@ package kieker.webgui.service; -import org.springframework.security.access.prepost.PreAuthorize; - import kieker.webgui.common.exception.GraphLayoutException; +import org.springframework.security.access.prepost.PreAuthorize; + /** * An interface for a service providing a graph layouter. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java index 2a3049764b69b550e777470ba280bbf08677a1c0..821ff024900b7862c165a0050cc8f0e912e2dfbb 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java @@ -20,8 +20,6 @@ import java.io.IOException; import java.util.Collection; import java.util.List; -import org.springframework.security.access.prepost.PreAuthorize; - import kieker.analysis.AnalysisController.STATE; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.webgui.common.ClassAndMethodContainer; @@ -35,6 +33,8 @@ import kieker.webgui.domain.ComponentListContainer; import org.primefaces.model.UploadedFile; +import org.springframework.security.access.prepost.PreAuthorize; + /** * This is the interface for a component which is responsible for managing all projects. This means that this interface can be used to create, copy, delete projects * as well as to start and stop the corresponding analyses and similar things. The facade should abstract from details like the (memory) locations and from diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IUserService.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IUserService.java index 6e2da22c2130f478bf3aa6435d0ddaf1adc9cd4d..56353e74aafc30839fbf10d8022cd1087baceee1 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IUserService.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IUserService.java @@ -17,11 +17,11 @@ package kieker.webgui.service; import java.util.List; -import org.springframework.security.access.prepost.PreAuthorize; - import kieker.webgui.common.exception.DataAccessException; import kieker.webgui.domain.User; +import org.springframework.security.access.prepost.PreAuthorize; + /** * This is an interface to the service which can be used to manage the available users within the system. The methods within this interface are only accessible by * administrators. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/GraphLayoutServiceImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/GraphLayoutServiceImpl.java index 5efacd2ac2861a2dac216afdc0898aacc2191172..5e5332bfd28a198d1901887ecaa3fd03069f7379 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/GraphLayoutServiceImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/GraphLayoutServiceImpl.java @@ -22,8 +22,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.springframework.stereotype.Service; - import kieker.webgui.common.exception.GraphLayoutException; import kieker.webgui.service.IGraphLayoutService; @@ -44,6 +42,8 @@ import de.cau.cs.kieler.kiml.options.PortConstraints; import de.cau.cs.kieler.kiml.util.KimlUtil; import de.cau.cs.kieler.klay.layered.LayeredLayoutProvider; +import org.springframework.stereotype.Service; + /** * This class provides a single method to perform an auto layout on a given graph from the GraphFlow. The JavaScript GraphFlow throws an "autoLayout"-Event upon * using the function autoLayout(). This event provides two Strings which may be used by this class' layoutGraph(nodes, edges) method. The return value can then be diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java index dcba8d58000bcf5cdb53766cd29846b9d0a6dffa..64d99a6091a50c6680acd155df71241481d69620 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java @@ -22,9 +22,6 @@ import java.util.List; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import kieker.analysis.AnalysisController.STATE; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.webgui.common.ClassAndMethodContainer; @@ -41,6 +38,9 @@ import kieker.webgui.service.impl.util.ACManager; import org.primefaces.model.UploadedFile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + /** * This is an implemented facade for the project management. For technical reasons it is a singleton class. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java index acaa55c6da0af6bb2bf004887a8f5cf80b1f5f5a..05436e4a38c4eb5adcb628b2e0c1e6b155e4186b 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java @@ -17,14 +17,14 @@ package kieker.webgui.service.impl; import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import kieker.webgui.common.exception.DataAccessException; import kieker.webgui.domain.User; import kieker.webgui.persistence.IUserDAO; import kieker.webgui.service.IUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + /** * This is an implementation of the {@link IUserService} interface. The work will be delegated to the underlying data access object. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/ACManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/ACManager.java index 2dd6f4d3e621f52b6fb749626769f80ffe154d8a..55542f17ae7def92c15f7e47318ef230642bd826 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/ACManager.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/ACManager.java @@ -18,9 +18,6 @@ package kieker.webgui.service.impl.util; import java.util.concurrent.ConcurrentHashMap; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import kieker.analysis.AnalysisController.STATE; import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.AnalysisStateException; @@ -28,6 +25,9 @@ import kieker.webgui.common.exception.DisplayNotFoundException; import kieker.webgui.common.exception.ProjectNotExistingException; import kieker.webgui.persistence.IProjectDAO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + /** * This manager is responsible for the currently used and running instances of {@code AnalysisController}. It supplies methods to check the states of analysis, * instantiate, start and to stop them. This is also a singleton instance. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java index 24e0634c3e08684c91138c9cbf55ae8ecf5062f7..5cafd10013436ec6b8599a5e0357244d58aa5cd9 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java @@ -25,11 +25,6 @@ import java.util.List; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.AnalysisController.STATE; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.common.logging.Log; @@ -43,6 +38,11 @@ import kieker.webgui.web.beans.view.CurrentProjectOverviewBean; import org.primefaces.model.UploadedFile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * This class is a {@code Spring} managed bean to manage a list with all application wide available projects. It provides methods to receive this list as well * as methods to add, create, rename, open and copy projects. Furthermore the state of existing projects (like the timestamp or the state of the analysis) can be diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/NewUserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/NewUserBean.java index 1f41503182544c41d2783b3a42472148fc662995..5425a517baafca8ff6d65a3d45ef317f65e50580 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/NewUserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/NewUserBean.java @@ -16,11 +16,11 @@ package kieker.webgui.web.beans.request; +import kieker.webgui.domain.User.Role; + import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; -import kieker.webgui.domain.User.Role; - /** * This simple {@code Spring} managed bean is request scoped and can be used to store the necessary data for a new user during a request. It should not be used, for * example, to deliver a list containing the available user within the system, as this bean contains a field for the password. For such cases you should use diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/UploadFileBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/UploadFileBean.java index eac5cab1f8c9b05a886885fdd9864948a8b26814..eb4586632535ae8ed15a1f71174326cf1e92d964 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/UploadFileBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/request/UploadFileBean.java @@ -16,11 +16,11 @@ package kieker.webgui.web.beans.request; +import org.primefaces.model.UploadedFile; + import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; -import org.primefaces.model.UploadedFile; - /** * This simple {@code Spring} managed bean is request scoped and can be used to store the necessary data for a file upload. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/session/UserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/session/UserBean.java index 62f839b57499c13f809592a43675f457b1dd7fc8..83c0812c97a55b7b094b852d8d93427f4358fa41 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/session/UserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/session/UserBean.java @@ -25,6 +25,8 @@ import javax.faces.context.FacesContext; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; +import kieker.webgui.web.beans.application.GlobalPropertiesBean; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.security.core.GrantedAuthority; @@ -32,8 +34,6 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Component; -import kieker.webgui.web.beans.application.GlobalPropertiesBean; - /** * This bean contains information about the user of this session (like the properties and configurations). This class is a {@code Spring} managed bean with session * scope. This means also that it is possible to login the same user multiple times.<br> diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java index e7f935681ba891214c2a142432ab3d061fee1ae1..42bb1ee321261b761e98dda7c172887721a044e6 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java @@ -26,10 +26,6 @@ import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.event.ValueChangeEvent; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.model.analysisMetaModel.MIAnalysisComponent; import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDependency; @@ -49,9 +45,10 @@ import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectNotExistingException; import kieker.webgui.domain.ComponentListContainer; -import kieker.webgui.domain.IComponentContainer; -import kieker.webgui.domain.PluginContainer; -import kieker.webgui.domain.RepositoryContainer; +import kieker.webgui.domain.pluginDecorators.AbstractAnalysisComponentDecorator; +import kieker.webgui.domain.pluginDecorators.FilterDecorator; +import kieker.webgui.domain.pluginDecorators.ReaderDecorator; +import kieker.webgui.domain.pluginDecorators.RepositoryDecorator; import kieker.webgui.service.IProjectService; import kieker.webgui.web.beans.application.GlobalPropertiesBean; import kieker.webgui.web.beans.application.ProjectsBean; @@ -61,6 +58,10 @@ import org.primefaces.context.RequestContext; import org.primefaces.event.FileUploadEvent; import org.primefaces.model.UploadedFile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * The {@link CurrentAnalysisEditorBean} contains the necessary data behind an instance of the analysis editor. It provides various methods to manipulate the current * project, as the analysis editor is the most important part of the whole application. The connection to the graph within the editor is done via another bean (the @@ -100,8 +101,8 @@ public class CurrentAnalysisEditorBean { * Creates a new instance of this class. <b>Do not call this constructor manually. It will only be accessed by Spring.</b> */ public CurrentAnalysisEditorBean() { - this.availableComponents = new ComponentListContainer(Collections.<PluginContainer>emptyList(), Collections.<PluginContainer>emptyList(), - Collections.<RepositoryContainer>emptyList()); + this.availableComponents = new ComponentListContainer(Collections.<ReaderDecorator>emptyList(), Collections.<FilterDecorator>emptyList(), + Collections.<RepositoryDecorator>emptyList()); } /** @@ -317,9 +318,9 @@ public class CurrentAnalysisEditorBean { * @param container * The container which delivers the copy of the repository. */ - public void addRepository(final RepositoryContainer container) { + public void addRepository(final RepositoryDecorator container) { // Create a new instance for the model - final MIRepository repository = container.newInstance(CurrentAnalysisEditorBean.FACTORY); + final MIRepository repository = container.newCopy(CurrentAnalysisEditorBean.FACTORY); // Add it to the project - and to the graph this.project.getRepositories().add(repository); @@ -334,9 +335,9 @@ public class CurrentAnalysisEditorBean { * @param container * The container which delivers the copy of the plugin. */ - public void addPlugin(final PluginContainer container) { + public void addPlugin(final FilterDecorator container) { // Create a new instance for the model - final MIPlugin plugin = container.newInstance(CurrentAnalysisEditorBean.FACTORY); + final MIPlugin plugin = container.newCopy(CurrentAnalysisEditorBean.FACTORY); // Add it to the project - and to the graph this.project.getPlugins().add(plugin); @@ -410,29 +411,29 @@ public class CurrentAnalysisEditorBean { * @return A human readable description and a substitution if there is no description. */ public String getDescription(final MIAnalysisComponent component, final String property) { - IComponentContainer container = null; + AbstractAnalysisComponentDecorator<? extends MIAnalysisComponent> container = null; // Find the container which contains the component if (component instanceof MIReader) { final String className = ((MIReader) component).getClassname(); - for (final PluginContainer reader : this.availableComponents.getReaders()) { - if (reader.getPlugin().getClassname().equals(className)) { + for (final ReaderDecorator reader : this.availableComponents.getReaders()) { + if (reader.getClassname().equals(className)) { container = reader; break; } } } else if (component instanceof MIFilter) { final String className = ((MIFilter) component).getClassname(); - for (final PluginContainer filter : this.availableComponents.getFilters()) { - if (filter.getPlugin().getClassname().equals(className)) { + for (final FilterDecorator filter : this.availableComponents.getFilters()) { + if (filter.getClassname().equals(className)) { container = filter; break; } } } else { final String className = ((MIRepository) component).getClassname(); - for (final RepositoryContainer repository : this.availableComponents.getRepositories()) { - if (repository.getRepository().getClassname().equals(className)) { + for (final RepositoryDecorator repository : this.availableComponents.getRepositories()) { + if (repository.getClassname().equals(className)) { container = repository; break; } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java index b49437042683a3cb68c69704412cb47784440c12..3e2148d55f3c7f9b05c253b99e34a5960c94d64c 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java @@ -20,10 +20,6 @@ import java.util.Map; import javax.faces.context.FacesContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.model.analysisMetaModel.MIAnalysisComponent; import kieker.analysis.model.analysisMetaModel.MIFilter; import kieker.analysis.model.analysisMetaModel.MIInputPort; @@ -44,6 +40,10 @@ import org.primefaces.context.RequestContext; import org.eclipse.emf.common.util.EList; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * The {@link CurrentAnalysisEditorGraphBean} contains the necessary data behind an graph of the analysis editor. It provides various methods to manipulate the * current graph.<br> diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java index 4226352c86928d8260341d05cfa481a64e9f5c74..2eb08c172f74acf0335c40ea6706d40b5502e256 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java @@ -23,10 +23,6 @@ import javax.faces.application.FacesMessage; import javax.faces.component.html.HtmlOutputText; import javax.faces.context.FacesContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.model.analysisMetaModel.MIDisplayConnector; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; @@ -46,6 +42,10 @@ import org.primefaces.model.DashboardModel; import org.primefaces.model.DefaultDashboardColumn; import org.primefaces.model.DefaultDashboardModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * This class is a {@code Spring} managed bean with view scope containing the necessary data behind an instance of the cockpit.<br> * <br/> diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitEditorBean.java index 37f2d079a3cff2facb54977422f5794b2fcdeec0..bea534ce25093d941133db0891a323517edef5a3 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitEditorBean.java @@ -29,13 +29,10 @@ import javax.faces.component.UIInput; import javax.faces.component.html.HtmlOutputText; import javax.faces.context.FacesContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDisplay; import kieker.analysis.model.analysisMetaModel.MIDisplayConnector; +import kieker.analysis.model.analysisMetaModel.MIPlugin; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; @@ -46,8 +43,10 @@ import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectNotExistingException; import kieker.webgui.domain.ComponentListContainer; -import kieker.webgui.domain.PluginContainer; -import kieker.webgui.domain.RepositoryContainer; +import kieker.webgui.domain.pluginDecorators.AbstractPluginDecorator; +import kieker.webgui.domain.pluginDecorators.FilterDecorator; +import kieker.webgui.domain.pluginDecorators.ReaderDecorator; +import kieker.webgui.domain.pluginDecorators.RepositoryDecorator; import kieker.webgui.service.IProjectService; import kieker.webgui.web.beans.application.GlobalPropertiesBean; import kieker.webgui.web.beans.application.ProjectsBean; @@ -62,6 +61,10 @@ import org.primefaces.model.DashboardModel; import org.primefaces.model.DefaultDashboardColumn; import org.primefaces.model.DefaultDashboardModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * The {@link CurrentCockpitEditorBean} contains the necessary data behind an instance of the cockpit editor. * The class is a Spring managed bean with view scope to make sure that one user (even in one session) can open multiple projects at a time without causing any @@ -103,8 +106,8 @@ public class CurrentCockpitEditorBean { * Creates a new instance of this class. <b>Do not call this constructor manually. It will only be accessed by Spring.</b> */ public CurrentCockpitEditorBean() { - this.availableComponents = new ComponentListContainer(Collections.<PluginContainer>emptyList(), Collections.<PluginContainer>emptyList(), - Collections.<RepositoryContainer>emptyList()); + this.availableComponents = new ComponentListContainer(Collections.<ReaderDecorator>emptyList(), Collections.<FilterDecorator>emptyList(), + Collections.<RepositoryDecorator>emptyList()); this.createDashboard(); } @@ -271,18 +274,18 @@ public class CurrentCockpitEditorBean { */ public String getDescription(final MIDisplay display) { final String parentClassname = display.getParent().getClassname(); - PluginContainer parentContainer = null; + AbstractPluginDecorator<? extends MIPlugin> parentContainer = null; // Find the correct parent container - for (final PluginContainer plugin : this.availableComponents.getFilters()) { - if (plugin.getPlugin().getClassname().equals(parentClassname)) { + for (final FilterDecorator plugin : this.availableComponents.getFilters()) { + if (plugin.getClassname().equals(parentClassname)) { parentContainer = plugin; break; } } if (parentContainer == null) { - for (final PluginContainer plugin : this.availableComponents.getReaders()) { - if (plugin.getPlugin().getClassname().equals(parentClassname)) { + for (final ReaderDecorator plugin : this.availableComponents.getReaders()) { + if (plugin.getClassname().equals(parentClassname)) { parentContainer = plugin; break; } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java index ccd34501a350fc383bc721e56b3f465130903147..b0106e6297b53bc0111bcbb811111b19ab576f96 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java @@ -25,10 +25,6 @@ import java.util.Collection; import java.util.Date; import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.AnalysisController; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; @@ -37,6 +33,10 @@ import kieker.webgui.common.exception.AnalysisStateException; import kieker.webgui.common.exception.ProjectNotExistingException; import kieker.webgui.service.IProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * /** * The {@link CurrentControllerBean} contains the necessary data behind an instance of the analysis controller. The class is a Spring managed bean with view scope to diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java index 48fe8371dfb4e82820bdf3f07fc05ab0b456f89b..0c26dc764666e942aed1aa19862d5a868e7dbe4c 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java @@ -21,14 +21,14 @@ import java.util.List; import javax.annotation.PostConstruct; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.webgui.web.beans.application.ProjectsBean; import org.primefaces.event.SelectEvent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * The {@link CurrentProjectOverviewBean} contains the necessary data behind an instance of the project overview.<br> * The class is a Spring managed bean with view scope. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentUserManagementBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentUserManagementBean.java index 548a0b4888300392c0287a5eac2846b9aaee86cd..fbb8823c7827168507375ef5bb6442407dbd4a6b 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentUserManagementBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentUserManagementBean.java @@ -22,10 +22,6 @@ import java.util.List; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.common.logging.Log; import kieker.common.logging.LogFactory; import kieker.webgui.common.exception.DataAccessException; @@ -34,6 +30,10 @@ import kieker.webgui.domain.User.Role; import kieker.webgui.service.IUserService; import kieker.webgui.web.beans.application.GlobalPropertiesBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + /** * The {@link CurrentUserManagementBean} contains the necessary data behind an instance of the user management page. * The class is a Spring managed bean with view scope to make sure that one user (even in one session) can open multiple instances of the page at a time without diff --git a/Kieker.WebGUI/src/main/webapp/pages/AnalysisEditorPage.xhtml b/Kieker.WebGUI/src/main/webapp/pages/AnalysisEditorPage.xhtml index 05991f6c3f8f7d113b7988212c6d36dcdbf90a78..eeee79fe28b6820ea9123bf73c235231cc658801 100644 --- a/Kieker.WebGUI/src/main/webapp/pages/AnalysisEditorPage.xhtml +++ b/Kieker.WebGUI/src/main/webapp/pages/AnalysisEditorPage.xhtml @@ -179,12 +179,12 @@ <p:accordionPanel multiple="true" activeIndex="0,1,2"> <p:tab title="#{localizedAnalysisEditorPageMessages.reader}"> <ui:repeat value="#{currentAnalysisEditorBean.availableComponents.readers}" var="reader"> - <p:commandLink id="readerLink" value="#{reader.plugin.name}" action="#{currentAnalysisEditorBean.addPlugin(reader)}" update=":messages" disabled="#{not reader.fullyInitialized}" /><br/> + <p:commandLink id="readerLink" value="#{reader.name}" action="#{currentAnalysisEditorBean.addPlugin(reader)}" update=":messages" disabled="#{not reader.fullyInitialized}" /><br/> <p:tooltip for="readerLink"> <b> <div align="center"> - <h:outputText value="#{reader.plugin.name}"/><br/> - <h:outputText value="(#{reader.plugin.classname})"/> + <h:outputText value="#{reader.name}"/><br/> + <h:outputText value="(#{reader.classname})"/> </div> </b> <br/> @@ -192,21 +192,21 @@ <ul> <li><h:outputText value="#{reader.description}"/></li> </ul> - <ui:fragment rendered="#{not empty reader.plugin.outputPorts}"> + <ui:fragment rendered="#{not empty reader.outputPorts}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.outputPorts}:"/></b> - <p:dataList value="#{reader.plugin.outputPorts}" var="port"> + <p:dataList value="#{reader.outputPorts}" var="port"> #{port.name} </p:dataList> </ui:fragment> - <ui:fragment rendered="#{not empty reader.plugin.repositories}"> + <ui:fragment rendered="#{not empty reader.repositories}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.repositoryPorts}:" /></b> - <p:dataList value="#{reader.plugin.repositories}" var="port"> + <p:dataList value="#{reader.repositories}" var="port"> #{port.name} </p:dataList> </ui:fragment> - <ui:fragment rendered="#{not empty reader.plugin.properties}"> + <ui:fragment rendered="#{not empty reader.properties}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.configuration}:"/></b> - <p:dataList value="#{reader.plugin.properties}" var="property"> + <p:dataList value="#{reader.properties}" var="property"> #{property.name} </p:dataList> </ui:fragment> @@ -221,12 +221,12 @@ </p:tab> <p:tab title="#{localizedAnalysisEditorPageMessages.filter}"> <ui:repeat value="#{currentAnalysisEditorBean.availableComponents.filters}" var="filter"> - <p:commandLink id="filterLink" value="#{filter.plugin.name}" action="#{currentAnalysisEditorBean.addPlugin(filter)}" update=":messages"/><br/> + <p:commandLink id="filterLink" value="#{filter.name}" action="#{currentAnalysisEditorBean.addPlugin(filter)}" update=":messages"/><br/> <p:tooltip for="filterLink" > <b> <div align="center"> - <h:outputText value="#{filter.plugin.name}"/><br/> - <h:outputText value="(#{filter.plugin.classname})"/> + <h:outputText value="#{filter.name}"/><br/> + <h:outputText value="(#{filter.classname})"/> </div> </b> <br/> @@ -234,27 +234,27 @@ <ul> <li><h:outputText value="#{filter.description}"/></li> </ul> - <ui:fragment rendered="#{not empty filter.plugin.inputPorts}"> + <ui:fragment rendered="#{not empty filter.inputPorts}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.inputPorts}:"/></b> - <p:dataList value="#{filter.plugin.inputPorts}" var="port"> + <p:dataList value="#{filter.inputPorts}" var="port"> #{port.name} </p:dataList> </ui:fragment> - <ui:fragment rendered="#{not empty filter.plugin.outputPorts}"> + <ui:fragment rendered="#{not empty filter.outputPorts}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.outputPorts}:"/></b> - <p:dataList value="#{filter.plugin.outputPorts}" var="port"> + <p:dataList value="#{filter.outputPorts}" var="port"> #{port.name} </p:dataList> </ui:fragment> - <ui:fragment rendered="#{not empty filter.plugin.repositories}"> + <ui:fragment rendered="#{not empty filter.repositories}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.repositoryPorts}:"/></b> - <p:dataList value="#{filter.plugin.repositories}" var="port"> + <p:dataList value="#{filter.repositories}" var="port"> #{port.name} </p:dataList> </ui:fragment> - <ui:fragment rendered="#{not empty filter.plugin.properties}"> + <ui:fragment rendered="#{not empty filter.properties}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.configuration}:"/></b> - <p:dataList value="#{filter.plugin.properties}" var="property"> + <p:dataList value="#{filter.properties}" var="property"> #{property.name} </p:dataList> </ui:fragment> @@ -269,12 +269,12 @@ </p:tab> <p:tab title="#{localizedAnalysisEditorPageMessages.repositories}"> <ui:repeat value="#{currentAnalysisEditorBean.availableComponents.repositories}" var="repository"> - <p:commandLink id="repositoryLink" value="#{repository.repository.name}" action="#{currentAnalysisEditorBean.addRepository(repository)}" update=":messages"/><br/> + <p:commandLink id="repositoryLink" value="#{repository.name}" action="#{currentAnalysisEditorBean.addRepository(repository)}" update=":messages"/><br/> <p:tooltip for="repositoryLink"> <b> <div align="center"> - <h:outputText value="#{repository.repository.name}"/><br/> - <h:outputText value="(#{repository.repository.classname})"/> + <h:outputText value="#{repository.name}"/><br/> + <h:outputText value="(#{repository.classname})"/> </div> </b> <br/> @@ -282,9 +282,9 @@ <ul> <li><h:outputText value="#{repository.description}"/></li> </ul> - <ui:fragment rendered="#{not empty repository.repository.properties}"> + <ui:fragment rendered="#{not empty repository.properties}"> <b><h:outputText value="#{localizedAnalysisEditorPageMessages.configuration}:"/></b> - <p:dataList value="#{repository.repository.properties}" var="property"> + <p:dataList value="#{repository.properties}" var="property"> #{property.name} </p:dataList> </ui:fragment>