This event is triggered when services are exposed.
org.apache.dubbo.rpc.ExporterListener
<!-- Service export listener -->
<dubbo:service listener="xxx,yyy" />
<!-- Default listener for service export -->
<dubbo:provider listener="xxx,yyy" />
org.apache.dubbo.registry.directory.RegistryExporterListener
Maven project structure:
src
|-main
|-java
|-com
|-xxx
|-XxxExporterListener.java (implements ExporterListener interface)
|-resources
|-META-INF
|-dubbo
|-org.apache.dubbo.rpc.ExporterListener (plain text file, content: xxx=com.xxx.XxxExporterListener)
XxxExporterListener.java:
package com.xxx;
import org.apache.dubbo.rpc.ExporterListener;
import org.apache.dubbo.rpc.Exporter;
import org.apache.dubbo.rpc.RpcException;
public class XxxExporterListener implements ExporterListener {
public void exported(Exporter<?> exporter) throws RpcException {
// ...
}
public void unexported(Exporter<?> exporter) throws RpcException {
// ...
}
}
META-INF/dubbo/org.apache.dubbo.rpc.ExporterListener:
xxx=com.xxx.XxxExporterListener