Kieker 1.5

kieker.analysis.plugin
Class AbstractPlugin

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

public abstract class AbstractPlugin
extends Object
implements IPlugin

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

Author:
Nils Christian Ehmke, Jan Waller

Nested Class Summary
 
Nested classes/interfaces inherited from interface kieker.analysis.plugin.IPlugin
IPlugin.PluginInputPortReference
 
Field Summary
static String CONFIG_NAME
           
 
Constructor Summary
AbstractPlugin(Configuration configuration)
          Each Plugin requires a constructor with a single Configuration object and an array of repositories!
 
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[] getAllInputPortNames()
           
 String[] getAllOutputPortNames()
           
 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.
 String getName()
          This method delivers the current name of this plugin instance.
 String getPluginDescription()
          This method delivers the description of this plugin type.
 String getPluginName()
          This method delivers the plugin name of this plugin.
static boolean isConnectionAllowed(AbstractPlugin src, String output, AbstractPlugin dst, String input)
          This method checks whether two plugins can be connected.
 
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
 

Field Detail

CONFIG_NAME

public static final String CONFIG_NAME
See Also:
Constant Field Values
Constructor Detail

AbstractPlugin

public AbstractPlugin(Configuration configuration)
Each Plugin requires a constructor with a single Configuration object and an array of repositories!

Method Detail

getName

public final String getName()
Description copied from interface: IPlugin
This method delivers the current name of this plugin instance. The name does not have to be unique.

Specified by:
getName in interface IPlugin
Returns:
The current name of the plugin instance.

getPluginName

public final String getPluginName()
Description copied from interface: IPlugin
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()
Description copied from interface: IPlugin
This method delivers the description of this plugin type.

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

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.

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.

connect

public final void connect(String reponame,
                          AbstractRepository repository)
                   throws AnalysisConfigurationException
Description copied from interface: IPlugin
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.

getCurrentRepositories

public final Map<String,AbstractRepository> getCurrentRepositories()
Description copied from interface: IPlugin
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.

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.

getAllOutputPortNames

public final String[] getAllOutputPortNames()
Specified by:
getAllOutputPortNames in interface IPlugin

getAllInputPortNames

public final String[] getAllInputPortNames()
Specified by:
getAllInputPortNames in interface IPlugin

getConnectedPlugins

public final List<IPlugin.PluginInputPortReference> getConnectedPlugins(String outputPortName)
Description copied from interface: IPlugin
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

Kieker 1.5

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