{
  "filename": "exporter-listener.md",
  "__html": "<h1>ExporterListener Extension</h1>\n<h2>Summary</h2>\n<p>Fire events when there's any service exported.</p>\n<h2>Extension Interface</h2>\n<p><code>com.alibaba.dubbo.rpc.ExporterListener</code></p>\n<h2>Extension Configuration</h2>\n<pre><code class=\"language-xml\"><span class=\"hljs-comment\">&lt;!-- service exporter listener --&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dubbo:service</span> <span class=\"hljs-attr\">listener</span>=<span class=\"hljs-string\">\"xxx,yyy\"</span> /&gt;</span>\n<span class=\"hljs-comment\">&lt;!-- default exporter listener for service provider --&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dubbo:provider</span> <span class=\"hljs-attr\">listener</span>=<span class=\"hljs-string\">\"xxx,yyy\"</span> /&gt;</span>\n</code></pre>\n<h2>Existing Extension</h2>\n<p><code>com.alibaba.dubbo.registry.directory.RegistryExporterListener</code></p>\n<h2>Extension Guide</h2>\n<p>Directory layout:</p>\n<pre><code>src\n |-main\n    |-java\n        |-com\n            |-xxx\n                |-XxxExporterListener.java (ExporterListener implementation)\n    |-resources\n        |-META-INF\n            |-dubbo\n                |-com.alibaba.dubbo.rpc.ExporterListener (plain text file with the content: xxx=com.xxx.XxxExporterListener)\n</code></pre>\n<p>XxxExporterListener.java：</p>\n<pre><code class=\"language-java\"><span class=\"hljs-keyword\">package</span> com.xxx;\n \n<span class=\"hljs-keyword\">import</span> com.alibaba.dubbo.rpc.ExporterListener;\n<span class=\"hljs-keyword\">import</span> com.alibaba.dubbo.rpc.Exporter;\n<span class=\"hljs-keyword\">import</span> com.alibaba.dubbo.rpc.RpcException;\n \n \n<span class=\"hljs-keyword\">public</span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class</span> <span class=\"hljs-title\">XxxExporterListener</span> <span class=\"hljs-keyword\">implements</span> <span class=\"hljs-title\">ExporterListener</span> </span>{\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">public</span> <span class=\"hljs-keyword\">void</span> <span class=\"hljs-title\">exported</span><span class=\"hljs-params\">(Exporter&lt;?&gt; exporter)</span> <span class=\"hljs-keyword\">throws</span> RpcException </span>{\n        <span class=\"hljs-comment\">// ...</span>\n    }\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">public</span> <span class=\"hljs-keyword\">void</span> <span class=\"hljs-title\">unexported</span><span class=\"hljs-params\">(Exporter&lt;?&gt; exporter)</span> <span class=\"hljs-keyword\">throws</span> RpcException </span>{\n        <span class=\"hljs-comment\">// ...</span>\n    }\n}\n</code></pre>\n<p>META-INF/dubbo/com.alibaba.dubbo.rpc.ExporterListener：</p>\n<pre><code class=\"language-properties\">xxx=com.xxx.XxxExporterListener\n</code></pre>\n"
}