編譯器擴展

擴充說明

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 (implement Compiler interface)
    |-resources
        |-META-INF
            |-dubbo
                |-org.apache.dubbo.common.compiler.Compiler (plain text file, content: 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

上次修改時間:2023 年 1 月 2 日:增強英文文件 (#1798) (95a9f4f6c1c)