Class OpenClassLoaderException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.classloader.exception.OpenClassLoaderException
- All Implemented Interfaces:
Serializable
ClassLoader Component Unified Exception
ClassLoader 组件统一异常
Exception class for class loading, resource access and metadata reading operations.
用于类加载、资源访问和元数据读取操作的异常类。
Features | 主要功能:
- Class not found exception - 类未找到异常
- Class load failed exception - 类加载失败异常
- Resource not found exception - 资源未找到异常
- Resource read failed exception - 资源读取失败异常
- Metadata parse failed exception - 元数据解析失败异常
Usage Examples | 使用示例:
throw OpenClassLoaderException.classNotFound("com.example.MyClass");
throw OpenClassLoaderException.resourceNotFound("config.yml");
throw OpenClassLoaderException.classLoadFailed("MyClass", cause);
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是 (不可变)
- Serializable: Yes - 可序列化: 是
- Since:
- JDK 25, opencode-base-classloader V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOpenClassLoaderException(String message) Create exception with message 创建带消息的异常OpenClassLoaderException(String message, Throwable cause) Create exception with message and cause 创建带消息和原因的异常 -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenClassLoaderExceptionCreate class loader closed exception 创建类加载器已关闭异常static OpenClassLoaderExceptionclassLoadFailed(String className, Throwable cause) Create class load failed exception 创建类加载失败异常static OpenClassLoaderExceptionclassNotFound(String className) Create class not found exception 创建类未找到异常static OpenClassLoaderExceptionclassNotFound(String className, Throwable cause) Create class not found exception with cause 创建带原因的类未找到异常Get the class name associated with this exception 获取与此异常关联的类名Get the resource name associated with this exception 获取与此异常关联的资源名static OpenClassLoaderExceptionmetadataParseFailed(String className, Throwable cause) Create metadata parse failed exception 创建元数据解析失败异常static OpenClassLoaderExceptionresourceNotFound(String resourceName) Create resource not found exception 创建资源未找到异常static OpenClassLoaderExceptionresourceReadFailed(String resourceName, Throwable cause) Create resource read failed exception 创建资源读取失败异常static OpenClassLoaderExceptionscanFailed(String packageName, Throwable cause) Create scan failed exception 创建扫描失败异常Methods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OpenClassLoaderException
Create exception with message 创建带消息的异常- Parameters:
message- exception message | 异常消息
-
OpenClassLoaderException
-
-
Method Details
-
classNotFound
Create class not found exception 创建类未找到异常- Parameters:
className- class name | 类名- Returns:
- exception instance | 异常实例
-
classNotFound
Create class not found exception with cause 创建带原因的类未找到异常- Parameters:
className- class name | 类名cause- root cause | 原始异常- Returns:
- exception instance | 异常实例
-
classLoadFailed
Create class load failed exception 创建类加载失败异常- Parameters:
className- class name | 类名cause- root cause | 原始异常- Returns:
- exception instance | 异常实例
-
resourceNotFound
Create resource not found exception 创建资源未找到异常- Parameters:
resourceName- resource name | 资源名- Returns:
- exception instance | 异常实例
-
resourceReadFailed
Create resource read failed exception 创建资源读取失败异常- Parameters:
resourceName- resource name | 资源名cause- root cause | 原始异常- Returns:
- exception instance | 异常实例
-
metadataParseFailed
Create metadata parse failed exception 创建元数据解析失败异常- Parameters:
className- class name | 类名cause- root cause | 原始异常- Returns:
- exception instance | 异常实例
-
scanFailed
Create scan failed exception 创建扫描失败异常- Parameters:
packageName- package name | 包名cause- root cause | 原始异常- Returns:
- exception instance | 异常实例
-
classLoaderClosed
Create class loader closed exception 创建类加载器已关闭异常- Returns:
- exception instance | 异常实例
-
getClassName
-
getResourceName
-