Package kieker.analysis
Class AnalysisController
java.lang.Object
kieker.analysis.AnalysisController
- All Implemented Interfaces:
IAnalysisController
,IProjectContext
@Deprecated public final class AnalysisController extends java.lang.Object implements IAnalysisController
Deprecated.
1.15 can be removed when all filter and tools have been ported to
TeeTime
The
AnalysisController
can be used to configure, control, save
and load an analysis instance. It is responsible for the life cycle of the
readers, filters and repositories.- Since:
- 0.95a
- Author:
- Andre van Hoorn, Matthias Rohr, Nils Christian Ehmke, Jan Waller
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnalysisController.AnalysisControllerWithMapping
Deprecated.This is a wrapper for theAnalysisController
which contains a mapping between the model instances and the actual objects as well.static interface
AnalysisController.IStateObserver
Deprecated.This interface can be used for observers which want to get notified about state changes of an analysis controller.static class
AnalysisController.STATE
Deprecated.An enumeration used to describe the state of anAnalysisController
. -
Field Summary
Fields inherited from interface kieker.analysis.IProjectContext
CONFIG_PROPERTY_NAME_PROJECT_NAME, CONFIG_PROPERTY_NAME_RECORDS_TIME_UNIT
-
Constructor Summary
Constructors Constructor Description AnalysisController()
Deprecated.Constructs anAnalysisController
instance.AnalysisController(java.io.File file)
Deprecated.This constructors creates anAnalysisController
instance, using the given file to load an analysis model.AnalysisController(java.io.File file, java.lang.ClassLoader classLoader)
Deprecated.This constructors creates anAnalysisController
instance, using the given file to load an analysis model and the given classloader to initialize the objects.AnalysisController(java.lang.String projectName)
Deprecated.Constructs anAnalysisController
instance using the given parameter.AnalysisController(MIProject project)
Deprecated.Creates a new instance of the classAnalysisController
but uses the given instance ofMIProject
to construct the analysis.AnalysisController(MIProject project, java.lang.ClassLoader classLoader)
Deprecated.Creates a new instance of the classAnalysisController
but uses the given instance of @link{Project} to construct the analysis.AnalysisController(Configuration configuration)
Deprecated.Constructs anAnalysisController
instance using the given parameter. -
Method Summary
Modifier and Type Method Description void
awaitInitialization()
Deprecated.Causes the calling thread to wait until the analysis controller has been initialized.void
connect(AbstractPlugin src, java.lang.String outputPortName, AbstractPlugin dst, java.lang.String inputPortName)
Deprecated.This method should be used to connect two plugins.void
connect(AbstractPlugin plugin, java.lang.String repositoryPort, AbstractRepository repository)
Deprecated.Connects the given repository to this plugin via the given name.static AnalysisController.AnalysisControllerWithMapping
createAnalysisController(MIProject project, java.lang.ClassLoader classLoader)
Deprecated.This is a factory method which can be used to create a new instance ofAnalysisController
, but delivers the mapping between theMIProject
and the actual analysis.MIProject
getCurrentConfiguration()
Deprecated.This method delivers the current configuration of this instance as an instance ofMIProject
.java.util.Collection<AbstractFilterPlugin>
getFilters()
Deprecated.Delivers an unmodifiable collection of all filters.java.lang.String
getProjectName()
Deprecated.Delivers the current name of the project.java.lang.String
getProperty(java.lang.String key)
Deprecated.Delivers the value for the given (global) property within the analysis.java.util.Collection<AbstractReaderPlugin>
getReaders()
Deprecated.Delivers an unmodifiable collection of all readers.java.util.Collection<AbstractRepository>
getRepositories()
Deprecated.Delivers an unmodifiable collection of all repositories.AnalysisController.STATE
getState()
Deprecated.Delivers the current state of the analysis controller.void
handleKiekerMetadataRecord(KiekerMetadataRecord record)
Deprecated.Called whenever anKiekerMetadataRecord
is found inside the filters network.static MIProject
loadFromFile(java.io.File file)
Deprecated.This method can be used to load a meta model instance from a given file.void
registerFilter(AbstractFilterPlugin filter)
Deprecated.Registers the given filter with this analysis instance.void
registerReader(AbstractReaderPlugin reader)
Deprecated.Registers the given reader with this analysis instance.void
registerRepository(AbstractRepository repository)
Deprecated.Registers the given repository with this analysis instance.void
registerStateObserver(AnalysisController.IStateObserver stateObserver)
Deprecated.Registers the given instance as a new state observer.void
run()
Deprecated.Starts anAnalysisController
instance.void
saveToFile(java.io.File file)
Deprecated.This method can be used to store the current configuration of this analysis controller in a specified file.static void
saveToFile(java.io.File file, MIProject project)
Deprecated.This method can be used to save the given instance ofMIProject
within a given file.void
saveToFile(java.lang.String pathname)
Deprecated.This method can be used to store the current configuration of this analysis controller in a specified file.void
terminate()
Deprecated.Initiates a termination of the analysis.void
terminate(boolean error)
Deprecated.Initiates a termination of the analysis.boolean
tryRegisterComponentName(java.lang.String name)
Deprecated.This method tries to atomically register the given name for a component.void
unregisterStateObserver(AnalysisController.IStateObserver stateObserver)
Deprecated.Unregisters the given instance from the state observers.
-
Constructor Details
-
AnalysisController
public AnalysisController()Deprecated.Constructs anAnalysisController
instance. -
AnalysisController
public AnalysisController(java.lang.String projectName)Deprecated.Constructs anAnalysisController
instance using the given parameter.- Parameters:
projectName
- The name of the project.
-
AnalysisController
public AnalysisController(java.io.File file) throws java.io.IOException, AnalysisConfigurationExceptionDeprecated.This constructors creates anAnalysisController
instance, using the given file to load an analysis model. The given file should therefore be an instance of the analysis meta model.- Parameters:
file
- The configuration file for the analysis.- Throws:
java.io.IOException
- If the given file could not be loaded or is not a valid kax-configuration file.AnalysisConfigurationException
- If one or more plugins or repositories could not be created, one or more properties of the plugins are invalid or if a connection between two filters is not allowed.
-
AnalysisController
public AnalysisController(java.io.File file, java.lang.ClassLoader classLoader) throws java.io.IOException, AnalysisConfigurationExceptionDeprecated.This constructors creates anAnalysisController
instance, using the given file to load an analysis model and the given classloader to initialize the objects. The given file should therefore be an instance of the analysis meta model.- Parameters:
file
- The configuration file for the analysis.classLoader
- The classloader used to initialize the plugins etc.- Throws:
java.io.IOException
- If the given file could not be loaded or is not a valid kax-configuration file.AnalysisConfigurationException
- If one or more plugins or repositories could not be created, one or more properties of the plugins are invalid or if a connection between two filters is not allowed.
-
AnalysisController
Deprecated.Creates a new instance of the classAnalysisController
but uses the given instance ofMIProject
to construct the analysis.- Parameters:
project
- The project instance for the analysis.- Throws:
AnalysisConfigurationException
- If the given project could not be loaded.java.lang.NullPointerException
- If the project is null.
-
AnalysisController
public AnalysisController(MIProject project, java.lang.ClassLoader classLoader) throws AnalysisConfigurationExceptionDeprecated.Creates a new instance of the classAnalysisController
but uses the given instance of @link{Project} to construct the analysis.- Parameters:
project
- The project instance for the analysis.classLoader
- The class loader used for the initializing.- Throws:
java.lang.NullPointerException
- If the project is null.AnalysisConfigurationException
- If the given project could not be loaded.
-
AnalysisController
Deprecated.Constructs anAnalysisController
instance using the given parameter.- Parameters:
configuration
- The global configuration of this analysis. All plugins can indirectly access it.
-
-
Method Details
-
handleKiekerMetadataRecord
Deprecated.Called whenever anKiekerMetadataRecord
is found inside the filters network. Currently this method only logs all details.- Parameters:
record
- the KiekerMetadataRecord containing the information
-
registerStateObserver
Deprecated.Registers the given instance as a new state observer. All instances are informed when the state (Running, Terminated etc) changes and get the new state as an object.- Specified by:
registerStateObserver
in interfaceIAnalysisController
- Parameters:
stateObserver
- The observer to be registered.
-
unregisterStateObserver
Deprecated.Unregisters the given instance from the state observers.- Specified by:
unregisterStateObserver
in interfaceIAnalysisController
- Parameters:
stateObserver
- The observer to be unregistered.
-
getProperty
public final java.lang.String getProperty(java.lang.String key)Deprecated.Delivers the value for the given (global) property within the analysis.- Specified by:
getProperty
in interfaceIProjectContext
- Parameters:
key
- The key of the property.- Returns:
- The value for the given property if it exists, an empty string otherwise.
-
saveToFile
public final void saveToFile(java.io.File file) throws java.io.IOException, AnalysisConfigurationExceptionDeprecated.This method can be used to store the current configuration of this analysis controller in a specified file. The file can later be used to initialize the analysis controller.- Specified by:
saveToFile
in interfaceIAnalysisController
- Parameters:
file
- The file in which the configuration will be stored.- Throws:
java.io.IOException
- If an exception during the storage occurred.AnalysisConfigurationException
- If the current configuration is somehow invalid.- See Also:
IAnalysisController.saveToFile(String)
-
saveToFile
public final void saveToFile(java.lang.String pathname) throws java.io.IOException, AnalysisConfigurationExceptionDeprecated.This method can be used to store the current configuration of this analysis controller in a specified file. It is just a convenient method which does the same as#saveToFile(File)
.- Specified by:
saveToFile
in interfaceIAnalysisController
- Parameters:
pathname
- The pathname of the file in which the configuration will be stored.- Throws:
java.io.IOException
- If an exception during the storage occurred.AnalysisConfigurationException
- If the current configuration is somehow invalid.- See Also:
IAnalysisController.saveToFile(File)
-
connect
public final void connect(AbstractPlugin src, java.lang.String outputPortName, AbstractPlugin dst, java.lang.String inputPortName) throws AnalysisConfigurationExceptionDeprecated.This method should be used to connect two plugins. The plugins have to be registered within this controller instance.- Specified by:
connect
in interfaceIAnalysisController
- Parameters:
src
- The source plugin.outputPortName
- The output port of the source plugin.dst
- The destination plugin.inputPortName
- The input port of the destination port.- Throws:
AnalysisConfigurationException
- If the port names or the given plugins are invalid or not compatible.
-
connect
public final void connect(AbstractPlugin plugin, java.lang.String repositoryPort, AbstractRepository repository) throws AnalysisConfigurationExceptionDeprecated.Connects the given repository to this plugin via the given name.- Specified by:
connect
in interfaceIAnalysisController
- Parameters:
plugin
- The plugin to be connected.repositoryPort
- The name of the port to connect the repository.repository
- The repository which should be used.- Throws:
AnalysisConfigurationException
- If the port names or the given objects are invalid or not compatible.
-
getCurrentConfiguration
Deprecated.This method delivers the current configuration of this instance as an instance ofMIProject
.- Specified by:
getCurrentConfiguration
in interfaceIProjectContext
- Returns:
- A filled meta model instance.
- Throws:
AnalysisConfigurationException
- If the current configuration is somehow invalid.
-
run
Deprecated.Starts anAnalysisController
instance. The method returns after all configured readers finished reading and all analysis plug-ins terminated On errors during the initialization, Exceptions are thrown.- Specified by:
run
in interfaceIAnalysisController
- Throws:
AnalysisConfigurationException
- If plugins with mandatory repositories have not been connected properly or couldn't be initialized.
-
awaitInitialization
public final void awaitInitialization()Deprecated.Causes the calling thread to wait until the analysis controller has been initialized. -
terminate
public final void terminate()Deprecated.Initiates a termination of the analysis.- Specified by:
terminate
in interfaceIAnalysisController
-
terminate
public final void terminate(boolean error)Deprecated.Initiates a termination of the analysis.- Specified by:
terminate
in interfaceIAnalysisController
- Parameters:
error
- Determines whether this is a normal termination or an termination due to an error during the analysis.
-
registerReader
Deprecated.Registers the given reader with this analysis instance. This method is for internal use only!- Parameters:
reader
- The reader to register with this analysis.- Throws:
java.lang.IllegalStateException
- If the analysis has already been started when this method is called.
-
registerFilter
Deprecated.Registers the given filter with this analysis instance. This method is for internal use only!- Parameters:
filter
- The filter to register with this analysis.- Throws:
java.lang.IllegalStateException
- If the analysis has already been started when this method is called.
-
registerRepository
Deprecated.Registers the given repository with this analysis instance. This method is for internal use only!- Parameters:
repository
- The repository to register with this analysis.- Throws:
java.lang.IllegalStateException
- If the analysis has already been started when this method is called.
-
getProjectName
public final java.lang.String getProjectName()Deprecated.Delivers the current name of the project.- Specified by:
getProjectName
in interfaceIProjectContext
- Returns:
- The current project name.
-
getReaders
Deprecated.Delivers an unmodifiable collection of all readers.- Specified by:
getReaders
in interfaceIAnalysisController
- Returns:
- All registered readers.
-
getFilters
Deprecated.Delivers an unmodifiable collection of all filters.- Specified by:
getFilters
in interfaceIAnalysisController
- Returns:
- All registered filters.
-
getRepositories
Deprecated.Delivers an unmodifiable collection of all repositories.- Specified by:
getRepositories
in interfaceIAnalysisController
- Returns:
- All registered repositories.
-
getState
Deprecated.Delivers the current state of the analysis controller.- Specified by:
getState
in interfaceIProjectContext
- Returns:
- The current state.
-
loadFromFile
Deprecated.This method can be used to load a meta model instance from a given file.- Parameters:
file
- The file to be loaded.- Returns:
- An instance of
MIProject
if everything went well. - Throws:
java.io.IOException
- If something during loading went wrong.
-
saveToFile
public static final void saveToFile(java.io.File file, MIProject project) throws java.io.IOExceptionDeprecated.This method can be used to save the given instance ofMIProject
within a given file.- Parameters:
file
- The file to be used for the storage.project
- The project to be stored.- Throws:
java.io.IOException
- In case of errors.
-
createAnalysisController
public static final AnalysisController.AnalysisControllerWithMapping createAnalysisController(MIProject project, java.lang.ClassLoader classLoader) throws AnalysisConfigurationExceptionDeprecated.This is a factory method which can be used to create a new instance ofAnalysisController
, but delivers the mapping between theMIProject
and the actual analysis. It calls the constructorAnalysisController(MIProject, ClassLoader)
.- Parameters:
project
- The project to be loaded.classLoader
- The class loader used to load the instances.- Returns:
- The newly created controller and the mapping.
- Throws:
java.lang.NullPointerException
- If the project is null.AnalysisConfigurationException
- If the given project could not be loaded.
-
tryRegisterComponentName
public boolean tryRegisterComponentName(java.lang.String name)Deprecated.This method tries to atomically register the given name for a component.- Parameters:
name
- The component name to register- Returns:
- true if and only if the given name is not already used and could now be registered.
-