This event is triggered when there is a service reference.
org.apache.dubbo.rpc.InvokerListener
<!-- Reference Service Listener -->
<dubbo:reference listener="xxx,yyy" />
<!-- Default Listener for Reference Services -->
<dubbo:consumer listener="xxx,yyy" />
org.apache.dubbo.rpc.listener.DeprecatedInvokerListener
Maven project structure:
src
|-main
|-java
|-com
|-xxx
|-XxxInvokerListener.java (implements InvokerListener interface)
|-resources
|-META-INF
|-dubbo
|-org.apache.dubbo.rpc.InvokerListener (text file containing: xxx=com.xxx.XxxInvokerListener)
XxxInvokerListener.java:
package com.xxx;
import org.apache.dubbo.rpc.InvokerListener;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
public class XxxInvokerListener implements InvokerListener {
public void referred(Invoker<?> invoker) throws RpcException {
// ...
}
public void destroyed(Invoker<?> invoker) throws RpcException {
// ...
}
}
META-INF/dubbo/org.apache.dubbo.rpc.InvokerListener:
xxx=com.xxx.XxxInvokerListener