Kieker 1.12

kieker.analysis.model
Class MetaModelHandler

java.lang.Object
  extended by kieker.analysis.model.MetaModelHandler

public final class MetaModelHandler
extends java.lang.Object

This is a helper class for the AnalysisController, which manages the handling of the meta model instances.

Since:
1.8
Author:
Andre van Hoorn, Nils Christian Ehmke, Jan Waller

Nested Class Summary
static class MetaModelHandler.PluginConnection
           
static class MetaModelHandler.RepositoryConnection
           
 
Method Summary
static void checkPorts(MIPlugin mPlugin, AbstractPlugin plugin)
          This method checks the ports of the given model plugin against the ports of the actual plugin.
static java.util.List<MIProperty> convertProperties(Configuration configuration, MAnalysisMetaModelFactory factory)
          Converts the given configuration into a list of MIPropertys using the given factory.
static MIInputPort findInputPort(MIFilter mPlugin, java.lang.String name)
          Searches for an input port within the given plugin with the given name.
static MIOutputPort findOutputPort(MIPlugin mPlugin, java.lang.String name)
          Searches for an output port within the given plugin with the given name.
static MIProject javaToMetaModel(java.util.Collection<AbstractReaderPlugin> readers, java.util.Collection<AbstractFilterPlugin> filters, java.util.Collection<AbstractRepository> repositories, java.util.Collection<MIDependency> dependencies, java.lang.String projectName, Configuration globalConfiguration)
          This method can be used to convert the current analysis configuration (which is represented by Java objects) into a meta model.
static MIProject loadProjectFromFile(java.io.File file)
          Loads a meta model project instance from the given file.
static void metaModelToJava(MIProject mProject, AnalysisController ac, java.util.Collection<MetaModelHandler.PluginConnection> pluginConnections, java.util.Collection<MetaModelHandler.RepositoryConnection> repositoryConnections, java.util.Collection<MIDependency> dependencies, java.lang.ClassLoader classLoader, Configuration globalConfiguration, java.util.Map<MIRepository,AbstractRepository> repositoryMap, java.util.Map<MIPlugin,AbstractPlugin> pluginMap)
          This method can be used to convert a given analysis meta model instance to the actual java instances.
static Configuration modelPropertiesToConfiguration(org.eclipse.emf.common.util.EList<MIProperty> mProperties)
          This method can be used to convert a given list of MIProperty to a configuration object.
static void saveProjectToFile(java.io.File file, MIProject project)
          Saves the given meta model project to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

saveProjectToFile

public static final void saveProjectToFile(java.io.File file,
                                           MIProject project)
                                    throws java.io.IOException
Saves the given meta model project to the given file.

Parameters:
file - The file in which the project will be stored.
project - The meta model project.
Throws:
java.io.IOException - If something went wrong during the saving.

loadProjectFromFile

public static final MIProject loadProjectFromFile(java.io.File file)
                                           throws java.io.IOException
Loads a meta model project instance from the given file.

Parameters:
file - The file to load the model from.
Returns:
The meta model instance.
Throws:
java.io.IOException - If something went wrong during the loading.

modelPropertiesToConfiguration

public static final Configuration modelPropertiesToConfiguration(org.eclipse.emf.common.util.EList<MIProperty> mProperties)
This method can be used to convert a given list of MIProperty to a configuration object.

Parameters:
mProperties - The properties to be converted.
Returns:
A filled configuration object.

checkPorts

public static void checkPorts(MIPlugin mPlugin,
                              AbstractPlugin plugin)
                       throws AnalysisConfigurationException
This method checks the ports of the given model plugin against the ports of the actual plugin. If there are ports which are in the model instance, but not in the "real" plugin, an exception is thrown. This method should be called during the creation of an AnalysisController via a configuration file to find invalid (outdated) ports.

Parameters:
mPlugin - The model instance of the plugin.
plugin - The corresponding "real" plugin.
Throws:
AnalysisConfigurationException - If an invalid port has been detected.

convertProperties

public static java.util.List<MIProperty> convertProperties(Configuration configuration,
                                                           MAnalysisMetaModelFactory factory)
Converts the given configuration into a list of MIPropertys using the given factory.

Parameters:
configuration - The configuration to be converted.
factory - The factory to be used to create the model instances.
Returns:
A list of model instances.

findInputPort

public static final MIInputPort findInputPort(MIFilter mPlugin,
                                              java.lang.String name)
Searches for an input port within the given plugin with the given name.

Parameters:
mPlugin - The plugin which will be searched through.
name - The name of the searched input port.
Returns:
The searched port or null, if it is not available.

findOutputPort

public static final MIOutputPort findOutputPort(MIPlugin mPlugin,
                                                java.lang.String name)
Searches for an output port within the given plugin with the given name.

Parameters:
mPlugin - The plugin which will be searched through.
name - The name of the searched output port.
Returns:
The searched port or null, if it is not available.

javaToMetaModel

public static final MIProject javaToMetaModel(java.util.Collection<AbstractReaderPlugin> readers,
                                              java.util.Collection<AbstractFilterPlugin> filters,
                                              java.util.Collection<AbstractRepository> repositories,
                                              java.util.Collection<MIDependency> dependencies,
                                              java.lang.String projectName,
                                              Configuration globalConfiguration)
                                       throws AnalysisConfigurationException
This method can be used to convert the current analysis configuration (which is represented by Java objects) into a meta model.

Parameters:
readers - The readers within the analysis.
filters - The filters within the analysis.
repositories - The repositories within the analysis.
dependencies - The dependencies of the analysis.
projectName - The name of the project.
globalConfiguration - The global project configuration.
Returns:
A meta model instance, representing the given analysis.
Throws:
AnalysisConfigurationException - If the given analysis components are somehow invalid connected.

metaModelToJava

public static final void metaModelToJava(MIProject mProject,
                                         AnalysisController ac,
                                         java.util.Collection<MetaModelHandler.PluginConnection> pluginConnections,
                                         java.util.Collection<MetaModelHandler.RepositoryConnection> repositoryConnections,
                                         java.util.Collection<MIDependency> dependencies,
                                         java.lang.ClassLoader classLoader,
                                         Configuration globalConfiguration,
                                         java.util.Map<MIRepository,AbstractRepository> repositoryMap,
                                         java.util.Map<MIPlugin,AbstractPlugin> pluginMap)
                                  throws AnalysisConfigurationException
This method can be used to convert a given analysis meta model instance to the actual java instances.

Parameters:
mProject - The meta model project.
ac - The analysis controller which will be the parent of the new analysis.
pluginConnections - The connections between the plugins (this object will be filled by the method).
repositoryConnections - The connections between filters and repositories (this object will be filled by the method).
dependencies - The dependencies of the analysis (this object will be filled by the method).
classLoader - The class loader which will be used to create the analysis components.
globalConfiguration - The global project configuration (this object will be filled by the method).
repositoryMap - The mapping between the created repositories and the meta model instances (this object will be filled by the method).
pluginMap - The mapping between the created plugins and the meta model instances (this object will be filled by the method).
Throws:
AnalysisConfigurationException - If the given meta model instance is somehow invalid configured.

Kieker 1.12

Copyright 2015 Kieker Project, http://kieker-monitoring.net