Class AbstractPlugin

java.lang.Object
All Implemented Interfaces:
IAnalysisComponent, IPlugin
Direct Known Subclasses:
AbstractFilterPlugin, AbstractReaderPlugin

@Deprecated
public abstract class AbstractPlugin
extends AbstractAnalysisComponent
implements IPlugin
Deprecated.
since 1.15.1 old plugin api
Do not inherit directly from this class! Instead inherit from the class AbstractFilterPlugin or AbstractReaderPlugin.
Since:
1.5
Author:
Nils Christian Ehmke, Jan Waller
  • Constructor Details

    • AbstractPlugin

      public AbstractPlugin​(Configuration configuration, IProjectContext projectContext)
      Deprecated.
      Each Plugin requires a constructor with a Configuration object and an IProjectContext.
      Parameters:
      configuration - The configuration for this component.
      projectContext - The project context for this component. The component will be registered.
  • Method Details

    • deliver

      protected final boolean deliver​(java.lang.String outputPortName, java.lang.Object data)
      Deprecated.
      Delivers the given data to all registered input ports of the given output port.
      Parameters:
      outputPortName - The output port to be used to send the given data.
      data - The data to be send; must not be null.
      Returns:
      true if and only if the given output port does exist and if the data is not null and if it suits the port's event types.
    • connect

      public final void connect​(java.lang.String reponame, AbstractRepository repository) throws AnalysisConfigurationException
      Deprecated.
      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, java.lang.String outputPortName, AbstractPlugin dst, java.lang.String inputPortName) throws AnalysisConfigurationException
      Deprecated.
      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, java.lang.String output, AbstractPlugin dst, java.lang.String input)
      Deprecated.
      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.
    • getDefaultConfiguration

      protected final Configuration getDefaultConfiguration()
      Deprecated.
      This method delivers an instance of Configuration containing the default properties for this class.
      Specified by:
      getDefaultConfiguration in class AbstractAnalysisComponent
      Returns:
      The default properties.
    • getPluginName

      public final java.lang.String getPluginName()
      Deprecated.
      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 java.lang.String getPluginDescription()
      Deprecated.
      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()
      Deprecated.
      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 java.util.Map<java.lang.String,​AbstractRepository> getCurrentRepositories()
      Deprecated.
      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.
    • getRepository

      protected final AbstractRepository getRepository​(java.lang.String reponame)
      Deprecated.
      Delivers the registered repository for the given name or null, if it doesn't exist.
      Parameters:
      reponame - The name (key) of the repository.
      Returns:
      The registered repository instance.
    • getAllOutputPortNames

      public final java.lang.String[] getAllOutputPortNames()
      Deprecated.
      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 java.lang.String[] getAllInputPortNames()
      Deprecated.
      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 java.lang.String[] getAllDisplayNames()
      Deprecated.
      Delivers an array containing all display names.
      Specified by:
      getAllDisplayNames in interface IPlugin
      Returns:
      An array with all available display names.
    • getAllRepositoryPortNames

      public final java.lang.String[] getAllRepositoryPortNames()
      Deprecated.
      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 java.util.List<IPlugin.PluginInputPortReference> getConnectedPlugins​(java.lang.String outputPortName)
      Deprecated.
      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()
      Deprecated.
      Specified by:
      getState in interface IPlugin
      Returns:
      the current state of the plugin
    • start

      public final boolean start()
      Deprecated.
      Starts this plugin.
      Returns:
      true if and only if the start procedure was sucesful.
    • shutdown

      public final void shutdown​(boolean error)
      Deprecated.
      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 java.util.Set<AbstractPlugin> getIncomingPlugins​(boolean transitive)
      Deprecated.
      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
    • notifyNewIncomingConnection

      protected void notifyNewIncomingConnection​(java.lang.String inputPortName, AbstractPlugin connectedPlugin, java.lang.String outputPortName) throws AnalysisConfigurationException
      Deprecated.
      Notification method which is called when a new incoming connection to this plugin is established.
      Parameters:
      inputPortName - The input port name to which the connection was established
      connectedPlugin - The plugin that was connected
      outputPortName - The opposing plugin's output port from which the connection was established
      Throws:
      AnalysisConfigurationException - If an error occurs while processing of this notification
    • notifyNewOutgoingConnection

      protected void notifyNewOutgoingConnection​(java.lang.String outputPortName, AbstractPlugin connectedPlugin, java.lang.String inputPortName) throws AnalysisConfigurationException
      Deprecated.
      Notification method which is called when a new outgoing connection from this plugin is established.
      Parameters:
      outputPortName - The output port name to which the connection was established
      connectedPlugin - The plugin that was connected
      inputPortName - The opposing plugin's input port from which the connection was established
      Throws:
      AnalysisConfigurationException - If an error occurs while processing of this notification