Package com.techcognita.javachatx.plugin
Class PluginManager
java.lang.Object
com.techcognita.javachatx.plugin.PluginManager
Manages plugins in the JavaChatX framework.
Handles plugin registration, configuration, and execution.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectexecutePlugin(String pluginId, com.google.gson.JsonObject input) Execute a plugin by its ID with the provided input.Get a registered plugin by its ID.intGet the number of registered plugins.voidregisterPlugin(Plugin plugin) Register a new plugin with the manager.voidunregisterPlugin(String pluginId) Unregister a plugin from the manager.
-
Constructor Details
-
PluginManager
public PluginManager()
-
-
Method Details
-
registerPlugin
Register a new plugin with the manager.- Parameters:
plugin- The plugin to register
-
unregisterPlugin
Unregister a plugin from the manager.- Parameters:
pluginId- The ID of the plugin to unregister
-
getPlugin
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 executeinput- 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
-