Interface IPlugin


public interface IPlugin
This interface represent an application plugin. An aplication plugin enable to extends an application with various functions. The plugin interface specifies the method necessary to the plugin manager for managing the plugin.
Since:
1.0.0
Version:
"1.0.14" - b202111241200L
Author:
Julien SEINTURIER - Université de Toulon / CNRS LIS umr 7020 - github.com/jorigin/jcommon (contact@jorigin.org)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Final identifier for the plugin state corresponding to initialized.
    static final int
    Identifier for the plugin state corresponding to started.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the dependencies of the plugin.
    Get the name of the plugin.
    int
    Return the state of the plugin.
    boolean
    Return true if the plugin is initialized.
    boolean
    Return true if the plugin is started, false otherwise.
    boolean
    Init the plugin and give the plugin a reference to the plugger where it is registered.
    boolean
    Method called when the plugger starts the plugin
    boolean
    Method called when the plugger stop the plugin
  • Field Details

  • Method Details

    • pluginInit

      boolean pluginInit(IPlugger plugger) throws Exception
      Init the plugin and give the plugin a reference to the plugger where it is registered.
      Parameters:
      plugger - plugger the reference to the plugger
      Returns:
      true if the plugin is correctly initialized, false otherwise.
      Throws:
      Exception - if an error occurs.
    • pluginStart

      boolean pluginStart()
      Method called when the plugger starts the plugin
      Returns:
      true if the plugin is started, false otherwise.
    • pluginStop

      boolean pluginStop()
      Method called when the plugger stop the plugin
      Returns:
      true if the plugin is stopped, false otherwise.
    • getName

      String getName()
      Get the name of the plugin. The name must be unique. The canonical name of the plugin class can be used.
      Returns:
      the name of the plugin.
    • getDependencies

      String[] getDependencies()
      Return the dependencies of the plugin. Dependencies are represented by the name of the required plugins to make this plugin to work.
      Returns:
      An array of plugin names.
    • getPluginState

      int getPluginState()
      Return the state of the plugin. State can be composed by: PLUGIN_INITIALIZED, PLUGIN_STARTED.
      Returns:
      the plugin state.
    • isPluginInitialized

      boolean isPluginInitialized()
      Return true if the plugin is initialized.
      Returns:
      true if the plugin is initialized, false otherwise.
    • isPluginStarted

      boolean isPluginStarted()
      Return true if the plugin is started, false otherwise.
      Returns:
      true if the plugin is started, false otherwise.