@Activate public class MigrationRuleListener extends Object implements RegistryProtocolListener, ConfigurationListener
- Migration rule is of consumer application scope. - Listener is shared among all invokers (interfaces), it keeps the relation between interface and handler.
There are two execution points: - Refer, invoker behaviour is determined with default rule. - Rule change, invoker behaviour is changed according to the newly received rule.
| 构造器和说明 |
|---|
MigrationRuleListener(ModuleModel moduleModel) |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<MigrationInvoker,MigrationRuleHandler> |
getHandlers() |
MigrationRule |
getRule() |
void |
onDestroy()
Notify RegistryProtocol's listeners when the protocol is destroyed
|
void |
onExport(RegistryProtocol registryProtocol,
org.apache.dubbo.rpc.Exporter<?> exporter)
Notify RegistryProtocol's listeners when a service is registered
|
void |
onRefer(RegistryProtocol registryProtocol,
ClusterInvoker<?> invoker,
URL consumerUrl,
URL registryURL)
Notify RegistryProtocol's listeners when a service is subscribed
|
void |
process(ConfigChangedEvent event) |
void |
setRawRule(String rawRule) |
public MigrationRuleListener(ModuleModel moduleModel)
public void process(ConfigChangedEvent event)
process 在接口中 ConfigurationListenerpublic void setRawRule(String rawRule)
public void onExport(RegistryProtocol registryProtocol, org.apache.dubbo.rpc.Exporter<?> exporter)
RegistryProtocolListeneronExport 在接口中 RegistryProtocolListenerregistryProtocol - RegistryProtocol instanceexporter - exporterRegistryProtocol.export(org.apache.dubbo.rpc.Invoker)public void onRefer(RegistryProtocol registryProtocol, ClusterInvoker<?> invoker, URL consumerUrl, URL registryURL)
RegistryProtocolListeneronRefer 在接口中 RegistryProtocolListenerregistryProtocol - RegistryProtocol instanceinvoker - invokerRegistryProtocol.refer(Class, URL)public void onDestroy()
RegistryProtocolListeneronDestroy 在接口中 RegistryProtocolListenerpublic Map<MigrationInvoker,MigrationRuleHandler> getHandlers()
public MigrationRule getRule()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.