编译器扩展
扩展说明
Java 代码编译器,用于动态生成字节码,加速调用。
扩展接口
org.apache.dubbo.common.compiler.Compiler
扩展配置
自动加载
已知扩展
org.apache.dubbo.common.compiler.support.JdkCompiler
org.apache.dubbo.common.compiler.support.JavassistCompiler
扩展示例
Maven 项目结构:
src
|-main
|-java
|-com
|-xxx
|-XxxCompiler.java (实现Compiler接口)
|-resources
|-META-INF
|-dubbo
|-org.apache.dubbo.common.compiler.Compiler (纯文本文件,内容为:xxx=com.xxx.XxxCompiler)
XxxCompiler.java:
package com.xxx;
import org.apache.dubbo.common.compiler.Compiler;
public class XxxCompiler implements Compiler {
public Object getExtension(Class<?> type, String name) {
// ...
}
}
META-INF/dubbo/org.apache.dubbo.common.compiler.Compiler:
xxx=com.xxx.XxxCompiler
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
最后修改 July 23, 2021: update metadata doc, add application level metadata info. (#876) (e71a2ba)