|
Kieker 1.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kieker.analysis.AnalysisController
public final class AnalysisController
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.
Nested Class Summary | |
---|---|
static class |
AnalysisController.AnalysisControllerWithMapping
This is a wrapper for the AnalysisController which contains a mapping between the model instances and the actual objects as well. |
static interface |
AnalysisController.IStateObserver
This interface can be used for observers which want to get notified about state changes of an analysis controller. |
static class |
AnalysisController.STATE
An enumeration used to describe the state of an AnalysisController . |
Field Summary |
---|
Fields inherited from interface kieker.analysis.IProjectContext |
---|
CONFIG_PROPERTY_NAME_PROJECT_NAME, CONFIG_PROPERTY_NAME_RECORDS_TIME_UNIT |
Constructor Summary | |
---|---|
AnalysisController()
Constructs an AnalysisController instance. |
|
AnalysisController(Configuration configuration)
Constructs an AnalysisController instance using the given parameter. |
|
AnalysisController(File file)
This constructors creates an AnalysisController instance, using the given file to load an analysis model. |
|
AnalysisController(File file,
ClassLoader classLoader)
This constructors creates an AnalysisController instance, using the given file to load an analysis model and the given classloader to initialize the
objects. |
|
AnalysisController(MIProject project)
Creates a new instance of the class AnalysisController but uses the given instance of MIProject to construct the analysis. |
|
AnalysisController(MIProject project,
ClassLoader classLoader)
Creates a new instance of the class AnalysisController but uses the given instance of @link{Project} to construct the analysis. |
|
AnalysisController(String projectName)
Constructs an AnalysisController instance using the given parameter. |
Method Summary | |
---|---|
void |
connect(AbstractPlugin src,
String outputPortName,
AbstractPlugin dst,
String inputPortName)
This method should be used to connect two plugins. |
void |
connect(AbstractPlugin plugin,
String repositoryPort,
AbstractRepository repository)
Connects the given repository to this plugin via the given name. |
static AnalysisController.AnalysisControllerWithMapping |
createAnalysisController(MIProject project,
ClassLoader classLoader)
This is a factory method which can be used to create a new instance of AnalysisController , but delivers the mapping between the MIProject and
the actual analysis. |
MIProject |
getCurrentConfiguration()
This method delivers the current configuration of this instance as an instance of MIProject . |
Collection<AbstractFilterPlugin> |
getFilters()
Delivers an unmodifiable collection of all filters. |
String |
getProjectName()
Delivers the current name of the project. |
String |
getProperty(String key)
Delivers the value for the given (global) property within the analysis. |
Collection<AbstractReaderPlugin> |
getReaders()
Delivers an unmodifiable collection of all readers. |
Collection<AbstractRepository> |
getRepositories()
Delivers an unmodifiable collection of all repositories. |
AnalysisController.STATE |
getState()
Delivers the current state of the analysis controller. |
void |
handleKiekerMetadataRecord(KiekerMetadataRecord record)
Called whenever an KiekerMetadataRecord is found inside the filters network. |
static MIProject |
loadFromFile(File file)
This method can be used to load a meta model instance from a given file. |
void |
registerFilter(AbstractFilterPlugin filter)
Registers the given filter with this analysis instance. |
void |
registerReader(AbstractReaderPlugin reader)
Registers the given reader with this analysis instance. |
void |
registerRepository(AbstractRepository repository)
Registers the given repository with this analysis instance. |
void |
registerStateObserver(AnalysisController.IStateObserver stateObserver)
Registers the given instance as a new state observer. |
void |
run()
Starts an AnalysisController instance. |
void |
saveToFile(File file)
This method can be used to store the current configuration of this analysis controller in a specified file. |
static void |
saveToFile(File file,
MIProject project)
This method can be used to save the given instance of MIProject within a given file. |
void |
saveToFile(String pathname)
This method can be used to store the current configuration of this analysis controller in a specified file. |
void |
terminate()
Initiates a termination of the analysis. |
void |
terminate(boolean error)
Initiates a termination of the analysis. |
boolean |
tryRegisterComponentName(String name)
This method tries to atomically register the given name for a component. |
void |
unregisterStateObserver(AnalysisController.IStateObserver stateObserver)
Unregisters the given instance from the state observers. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnalysisController()
AnalysisController
instance.
public AnalysisController(String projectName)
AnalysisController
instance using the given parameter.
projectName
- The name of the project.public AnalysisController(File file) throws IOException, AnalysisConfigurationException
AnalysisController
instance, using the given file to load an analysis model. The given file should therefore be an
instance of the analysis meta model.
file
- The configuration file for the analysis.
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.public AnalysisController(File file, ClassLoader classLoader) throws IOException, AnalysisConfigurationException
AnalysisController
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.
file
- The configuration file for the analysis.classLoader
- The classloader used to initialize the plugins etc.
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.public AnalysisController(MIProject project) throws NullPointerException, AnalysisConfigurationException
AnalysisController
but uses the given instance of MIProject
to construct the analysis.
project
- The project instance for the analysis.
AnalysisConfigurationException
- If the given project could not be loaded.
NullPointerException
- If the project is null.public AnalysisController(MIProject project, ClassLoader classLoader) throws NullPointerException, AnalysisConfigurationException
AnalysisController
but uses the given instance of @link{Project} to construct the analysis.
project
- The project instance for the analysis.classLoader
- The class loader used for the initializing.
NullPointerException
- If the project is null.
AnalysisConfigurationException
- If the given project could not be loaded.public AnalysisController(Configuration configuration)
AnalysisController
instance using the given parameter.
configuration
- The global configuration of this analysis. All plugins can indirectly access it.Method Detail |
---|
public final void handleKiekerMetadataRecord(KiekerMetadataRecord record)
KiekerMetadataRecord
is found inside the filters network.
Currently this method only logs all details.
record
- the KiekerMetadataRecord containing the informationpublic final void registerStateObserver(AnalysisController.IStateObserver stateObserver)
registerStateObserver
in interface IAnalysisController
stateObserver
- The observer to be registered.public final void unregisterStateObserver(AnalysisController.IStateObserver stateObserver)
unregisterStateObserver
in interface IAnalysisController
stateObserver
- The observer to be unregistered.public final String getProperty(String key)
getProperty
in interface IProjectContext
key
- The key of the property.
public final void saveToFile(File file) throws IOException, AnalysisConfigurationException
saveToFile
in interface IAnalysisController
file
- The file in which the configuration will be stored.
IOException
- If an exception during the storage occurred.
AnalysisConfigurationException
- If the current configuration is somehow invalid.IAnalysisController.saveToFile(String)
public final void saveToFile(String pathname) throws IOException, AnalysisConfigurationException
#saveToFile(File)
.
saveToFile
in interface IAnalysisController
pathname
- The pathname of the file in which the configuration will be stored.
IOException
- If an exception during the storage occurred.
AnalysisConfigurationException
- If the current configuration is somehow invalid.IAnalysisController.saveToFile(File)
public final void connect(AbstractPlugin src, String outputPortName, AbstractPlugin dst, String inputPortName) throws IllegalStateException, AnalysisConfigurationException
connect
in interface IAnalysisController
src
- The source plugin.outputPortName
- The output port of the source plugin.dst
- The destination plugin.inputPortName
- The input port of the destination port.
IllegalStateException
- If this instance has already been started or has already been terminated.
AnalysisConfigurationException
- If the port names or the given plugins are invalid or not compatible.public final void connect(AbstractPlugin plugin, String repositoryPort, AbstractRepository repository) throws IllegalStateException, AnalysisConfigurationException
connect
in interface IAnalysisController
plugin
- The plugin to be connected.repositoryPort
- The name of the port to connect the repository.repository
- The repository which should be used.
IllegalStateException
- If this instance has already been started or has already been terminated.
AnalysisConfigurationException
- If the port names or the given objects are invalid or not compatible.public final MIProject getCurrentConfiguration() throws AnalysisConfigurationException
MIProject
.
getCurrentConfiguration
in interface IProjectContext
AnalysisConfigurationException
- If the current configuration is somehow invalid.public final void run() throws IllegalStateException, AnalysisConfigurationException
AnalysisController
instance.
The method returns after all configured readers finished reading and all analysis plug-ins terminated
On errors during the initialization, Exceptions are thrown.
run
in interface IAnalysisController
IllegalStateException
- If the current instance has already been started or already been terminated.
AnalysisConfigurationException
- If plugins with mandatory repositories have not been connected properly or couldn't be initialized.public final void terminate()
terminate
in interface IAnalysisController
public final void terminate(boolean error)
terminate
in interface IAnalysisController
error
- Determines whether this is a normal termination or an termination due to an error during the analysis.public final void registerReader(AbstractReaderPlugin reader) throws IllegalStateException
reader
- The reader to register with this analysis.
IllegalStateException
- If the analysis has already been started when this method is called.public final void registerFilter(AbstractFilterPlugin filter) throws IllegalStateException
filter
- The filter to register with this analysis.
IllegalStateException
- If the analysis has already been started when this method is called.public final void registerRepository(AbstractRepository repository) throws IllegalStateException
repository
- The repository to register with this analysis.
IllegalStateException
- If the analysis has already been started when this method is called.public final String getProjectName()
getProjectName
in interface IProjectContext
public final Collection<AbstractReaderPlugin> getReaders()
getReaders
in interface IAnalysisController
public final Collection<AbstractFilterPlugin> getFilters()
getFilters
in interface IAnalysisController
public final Collection<AbstractRepository> getRepositories()
getRepositories
in interface IAnalysisController
public final AnalysisController.STATE getState()
getState
in interface IProjectContext
public static final MIProject loadFromFile(File file) throws IOException
file
- The file to be loaded.
MIProject
if everything went well.
IOException
- If something during loading went wrong.public static final void saveToFile(File file, MIProject project) throws IOException
MIProject
within a given file.
file
- The file to be used for the storage.project
- The project to be stored.
IOException
- In case of errors.public static final AnalysisController.AnalysisControllerWithMapping createAnalysisController(MIProject project, ClassLoader classLoader) throws NullPointerException, AnalysisConfigurationException
AnalysisController
, but delivers the mapping between the MIProject
and
the actual analysis. It calls the constructor AnalysisController(MIProject, ClassLoader)
.
project
- The project to be loaded.classLoader
- The class loader used to load the instances.
NullPointerException
- If the project is null.
AnalysisConfigurationException
- If the given project could not be loaded.public boolean tryRegisterComponentName(String name)
name
- The component name to register
|
Kieker 1.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |