Class PluginHandle

java.lang.Object
cloud.opencode.base.classloader.plugin.PluginHandle

public class PluginHandle extends Object
Plugin handle - Provides access to a loaded plugin and its state 插件句柄 - 提供对已加载插件及其状态的访问

Encapsulates a loaded plugin instance along with its descriptor, ClassLoader, and current lifecycle state. State transitions are managed by PluginManager.

封装已加载的插件实例及其描述符、ClassLoader 和当前生命周期状态。 状态转换由 PluginManager 管理。

Security | 安全性:

  • Thread-safe: State is volatile - 线程安全: 状态为 volatile
  • Null-safe: Yes (constructor validates) - 空值安全: 是 (构造器校验)
Since:
JDK 25, opencode-base-classloader V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • getPluginId

      public String getPluginId()
      Get the unique plugin identifier 获取唯一的插件标识符
      Returns:
      the plugin id | 插件 ID
    • getDescriptor

      public PluginDescriptor getDescriptor()
      Get the plugin descriptor 获取插件描述符
      Returns:
      the descriptor | 描述符
    • getClassLoader

      public IsoClassLoader getClassLoader()
      Get the isolated ClassLoader for this plugin 获取此插件的隔离 ClassLoader
      Returns:
      the ClassLoader | 类加载器
    • getPlugin

      public Plugin getPlugin()
      Get the plugin instance 获取插件实例
      Returns:
      the plugin instance | 插件实例
    • getState

      public PluginState getState()
      Get the current plugin state 获取当前插件状态
      Returns:
      the current state | 当前状态
    • toString

      public String toString()
      Overrides:
      toString in class Object