Extension Point Loading Extensions

Extension Point Loading Extensions

Extension Description

The loading container for extension points, capable of loading extension points from different containers.

Extension Interface

org.apache.dubbo.common.extension.ExtensionFactory

Extension Configuration

  1. <dubbo:application compiler="jdk" />

Known Extensions

  • org.apache.dubbo.common.extension.factory.SpiExtensionFactory
  • org.apache.dubbo.config.spring.extension.SpringExtensionFactory

Extension Example

Maven project structure:

  1. src
  2. |-main
  3. |-java
  4. |-com
  5. |-xxx
  6. |-XxxExtensionFactory.java (implements ExtensionFactory interface)
  7. |-resources
  8. |-META-INF
  9. |-dubbo
  10. |-org.apache.dubbo.common.extension.ExtensionFactory (plain text file, content: xxx=com.xxx.XxxExtensionFactory)

XxxExtensionFactory.java:

  1. package com.xxx;
  2. import org.apache.dubbo.common.extension.ExtensionFactory;
  3. public class XxxExtensionFactory implements ExtensionFactory {
  4. public Object getExtension(Class<?> type, String name) {
  5. // ...
  6. }
  7. }

META-INF/dubbo/org.apache.dubbo.common.extension.ExtensionFactory:

  1. xxx=com.xxx.XxxExtensionFactory

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)