Class PluginManager

java.lang.Object
com.techcognita.javachatx.plugin.PluginManager

public class PluginManager extends Object
Manages plugins in the JavaChatX framework. Handles plugin registration, configuration, and execution.
  • Constructor Details

    • PluginManager

      public PluginManager()
  • Method Details

    • registerPlugin

      public void registerPlugin(Plugin plugin)
      Register a new plugin with the manager.
      Parameters:
      plugin - The plugin to register
    • unregisterPlugin

      public void unregisterPlugin(String pluginId)
      Unregister a plugin from the manager.
      Parameters:
      pluginId - The ID of the plugin to unregister
    • getPlugin

      public Plugin getPlugin(String pluginId)
      Get a registered plugin by its ID.
      Parameters:
      pluginId - The ID of the plugin to retrieve
      Returns:
      The plugin, or null if not found
    • executePlugin

      public com.google.gson.JsonObject executePlugin(String pluginId, com.google.gson.JsonObject input) throws PluginException
      Execute a plugin by its ID with the provided input.
      Parameters:
      pluginId - The ID of the plugin to execute
      input - The input data for the plugin
      Returns:
      The result of the plugin execution
      Throws:
      PluginException - If there's an error executing the plugin
    • getPluginCount

      public int getPluginCount()
      Get the number of registered plugins.
      Returns:
      The number of registered plugins