Kieker 1.9

kieker.analysis.plugin
Class AbstractPlugin

java.lang.Object
  extended by kieker.analysis.analysisComponent.AbstractAnalysisComponent
      extended by kieker.analysis.plugin.AbstractPlugin
All Implemented Interfaces:
IAnalysisComponent, IPlugin
Direct Known Subclasses:
AbstractFilterPlugin, AbstractReaderPlugin

public abstract class AbstractPlugin
extends AbstractAnalysisComponent
implements IPlugin

Do not inherit directly from this class! Instead inherit from the class AbstractFilterPlugin or AbstractReaderPlugin.

Since:
1.5
Author:
Nils Christian Ehmke, Jan Waller

Nested Class Summary
 
Nested classes/interfaces inherited from interface kieker.analysis.plugin.IPlugin
IPlugin.PluginInputPortReference, IPlugin.STATE
 
Field Summary
 
Fields inherited from class kieker.analysis.analysisComponent.AbstractAnalysisComponent
CONFIG_NAME
 
Constructor Summary
AbstractPlugin(Configuration configuration, IProjectContext projectContext)
          Each Plugin requires a constructor with a Configuration object and a IProjectContext.
 
Method Summary
 boolean areAllRepositoryPortsConnected()
          This method checks whether all repository ports of the current plugin are connected.
static void connect(AbstractPlugin src, String outputPortName, AbstractPlugin dst, String inputPortName)
          This method connects two plugins.
 void connect(String reponame, AbstractRepository repository)
          Connects the given repository to this plugin via the given name.
 String[] getAllDisplayNames()
          Delivers an array containing all display names.
 String[] getAllInputPortNames()
          Delivers an array containing all input port names.
 String[] getAllOutputPortNames()
          Delivers an array containing all output port names.
 String[] getAllRepositoryPortNames()
          Delivers an array containing all repository port names.
 List<IPlugin.PluginInputPortReference> getConnectedPlugins(String outputPortName)
          Delivers the plugins with their ports which are connected with the given output port.
 Map<String,AbstractRepository> getCurrentRepositories()
          This method delivers an array of AbstractRepository containing the current repositories of this instance.
 Set<AbstractPlugin> getIncomingPlugins(boolean transitive)
          Returns the plugins which provide data to this plugin.
 String getPluginDescription()
          This method delivers the description of this plugin type.
 String getPluginName()
          This method delivers the plugin name of this plugin.
 IPlugin.STATE getState()
          
static boolean isConnectionAllowed(AbstractPlugin src, String output, AbstractPlugin dst, String input)
          This method checks whether two plugins can be connected.
 void shutdown(boolean error)
          Initializes a shutdown of this and all incoming plugins.
 boolean start()
          Starts this plugin.
 
Methods inherited from class kieker.analysis.analysisComponent.AbstractAnalysisComponent
getCurrentConfiguration, getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface kieker.analysis.plugin.IPlugin
getCurrentConfiguration, getName, init, terminate
 

Constructor Detail

AbstractPlugin

public AbstractPlugin(Configuration configuration,
                      IProjectContext projectContext)
Each Plugin requires a constructor with a Configuration object and a IProjectContext.

Parameters:
configuration - The configuration for this component.
projectContext - The project context for this component. The component will be registered.
Method Detail

connect

public final void connect(String reponame,
                          AbstractRepository repository)
                   throws AnalysisConfigurationException
Connects the given repository to this plugin via the given name. DO NOT USE THIS METHOD! Use AnalysisController.connect instead!

Specified by:
connect in interface IPlugin
Parameters:
reponame - The name of the port to connect the repository.
repository - The repository which should be used.
Throws:
AnalysisConfigurationException - if the repository-port is invalid, the repository itself is incompatible or the port is already used.

connect

public static final void connect(AbstractPlugin src,
                                 String outputPortName,
                                 AbstractPlugin dst,
                                 String inputPortName)
                          throws AnalysisConfigurationException
This method connects two plugins. DO NOT USE THIS METHOD! Use AnalysisController.connect instead!

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 any given plugin is invalid, any output or input port doesn't exist or if they are incompatible. Furthermore the destination plugin must not be a reader.

isConnectionAllowed

public static final boolean isConnectionAllowed(AbstractPlugin src,
                                                String output,
                                                AbstractPlugin dst,
                                                String input)
This method checks whether two plugins can be connected.

Parameters:
src - The source plugin.
output - The output port of the source plugin.
dst - The destination plugin.
input - The input port of the destination port.
Returns:
true if and only if both given plugins are valid, the output and input ports exist and if they are compatible. Furthermore the destination plugin must not be a reader.

getPluginName

public final String getPluginName()
This method delivers the plugin name of this plugin. The name should be unique, e.g., the classname.

Specified by:
getPluginName in interface IPlugin
Returns:
The name of the plugin.

getPluginDescription

public final String getPluginDescription()
This method delivers the description of this plugin type.

Specified by:
getPluginDescription in interface IPlugin
Returns:
The description of the plugin type.

areAllRepositoryPortsConnected

public final boolean areAllRepositoryPortsConnected()
This method checks whether all repository ports of the current plugin are connected.

Returns:
true if and only if all plugin ports (defined in the annotation) are connected to a repository.

getCurrentRepositories

public final Map<String,AbstractRepository> getCurrentRepositories()
This method delivers an array of AbstractRepository containing the current repositories of this instance. In other words: The constructor should be able to use the given object to initialize a new instance of this class with the same intern properties.

Specified by:
getCurrentRepositories in interface IPlugin
Returns:
An (possible empty) array of repositories.

getAllOutputPortNames

public final String[] getAllOutputPortNames()
Delivers an array containing all output port names.

Specified by:
getAllOutputPortNames in interface IPlugin
Returns:
An array with all available output port names.

getAllInputPortNames

public final String[] getAllInputPortNames()
Delivers an array containing all input port names.

Specified by:
getAllInputPortNames in interface IPlugin
Returns:
An array with all available input port names.

getAllDisplayNames

public final String[] getAllDisplayNames()
Delivers an array containing all display names.

Specified by:
getAllDisplayNames in interface IPlugin
Returns:
An array with all available display names.

getAllRepositoryPortNames

public final String[] getAllRepositoryPortNames()
Delivers an array containing all repository port names.

Specified by:
getAllRepositoryPortNames in interface IPlugin
Returns:
An array with all available repository port names.

getConnectedPlugins

public final List<IPlugin.PluginInputPortReference> getConnectedPlugins(String outputPortName)
Delivers the plugins with their ports which are connected with the given output port.

Specified by:
getConnectedPlugins in interface IPlugin
Parameters:
outputPortName - The name of the output port.
Returns:
An array of pairs, whereat the first element is the plugin and the second one the name of the input port. If the given output port is invalid, null is returned

getState

public final IPlugin.STATE getState()

Specified by:
getState in interface IPlugin
Returns:
the current state of the plugin

start

public final boolean start()
Starts this plugin.

Returns:
true if and only if the start procedure was sucesful.

shutdown

public final void shutdown(boolean error)
Initializes a shutdown of this and all incoming plugins.

Parameters:
error - A flag determining whether this plugin has to be shutdown due to an error or not.

getIncomingPlugins

public Set<AbstractPlugin> getIncomingPlugins(boolean transitive)
Returns the plugins which provide data to this plugin.

Parameters:
transitive - Denotes whether indirect (i.e. non-immediate) providers should be returned
Returns:
A set of plugins which directly or indirectly (see above) provide data for this plugin

Kieker 1.9

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