容器扩展

容器扩展

此文档已经不再维护。您当前查看的是快照版本。如果想要查看最新版本的文档,请参阅最新版本

扩展说明

服务容器扩展,用于自定义加载内容。

扩展接口

org.apache.dubbo.container.Container

扩展配置

java org.apache.dubbo.container.Main spring jetty log4j

已知扩展

  • org.apache.dubbo.container.spring.SpringContainer
  • org.apache.dubbo.container.spring.JettyContainer
  • org.apache.dubbo.container.spring.Log4jContainer

扩展示例

Maven 项目结构:

src
 |-main
    |-java
        |-com
            |-xxx
                |-XxxContainer.java (实现Container接口)
    |-resources
        |-META-INF
            |-dubbo
                |-org.apache.dubbo.container.Container (纯文本文件,内容为:xxx=com.xxx.XxxContainer)

XxxContainer.java:

package com.xxx;
 
org.apache.dubbo.container.Container;
 
 
public class XxxContainer implements Container {
    public Status start() {
        // ...
    }
    public Status stop() {
        // ...
    }
}

META-INF/dubbo/org.apache.dubbo.container.Container:

xxx=com.xxx.XxxContainer

最后修改 March 1, 2023: Move sdk docs (#2337) (ceab0ea115a)