类 MigrationRuleListener
- java.lang.Object
-
- org.apache.dubbo.registry.client.migration.MigrationRuleListener
-
@Activate public class MigrationRuleListener extends Object implements RegistryProtocolListener, ConfigurationListener
Listens to from Config Center. - 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()MigrationRulegetRule()voidonDestroy()Notify RegistryProtocol's listeners when the protocol is destroyedvoidonExport(RegistryProtocol registryProtocol, org.apache.dubbo.rpc.Exporter<?> exporter)Notify RegistryProtocol's listeners when a service is registeredvoidonRefer(RegistryProtocol registryProtocol, ClusterInvoker<?> invoker, URL consumerUrl, URL registryURL)Notify RegistryProtocol's listeners when a service is subscribedvoidprocess(ConfigChangedEvent event)voidsetRawRule(String rawRule)
-
-
-
构造器详细资料
-
MigrationRuleListener
public MigrationRuleListener(ModuleModel moduleModel)
-
-
方法详细资料
-
process
public void process(ConfigChangedEvent event)
- 指定者:
process在接口中ConfigurationListener
-
setRawRule
public void setRawRule(String rawRule)
-
onExport
public void onExport(RegistryProtocol registryProtocol, org.apache.dubbo.rpc.Exporter<?> exporter)
从接口复制的说明:RegistryProtocolListenerNotify RegistryProtocol's listeners when a service is registered- 指定者:
onExport在接口中RegistryProtocolListener- 参数:
registryProtocol- RegistryProtocol instanceexporter- exporter- 另请参阅:
RegistryProtocol.export(org.apache.dubbo.rpc.Invoker)
-
onRefer
public void onRefer(RegistryProtocol registryProtocol, ClusterInvoker<?> invoker, URL consumerUrl, URL registryURL)
从接口复制的说明:RegistryProtocolListenerNotify RegistryProtocol's listeners when a service is subscribed- 指定者:
onRefer在接口中RegistryProtocolListener- 参数:
registryProtocol- RegistryProtocol instanceinvoker- invoker- 另请参阅:
RegistryProtocol.refer(Class, URL)
-
onDestroy
public void onDestroy()
从接口复制的说明:RegistryProtocolListenerNotify RegistryProtocol's listeners when the protocol is destroyed- 指定者:
onDestroy在接口中RegistryProtocolListener
-
getHandlers
public Map<MigrationInvoker,MigrationRuleHandler> getHandlers()
-
getRule
public MigrationRule getRule()
-
-