Class MigrationRuleListener
java.lang.Object
org.apache.dubbo.registry.client.migration.MigrationRuleListener
- All Implemented Interfaces:
EventListener,ConfigurationListener,RegistryProtocolListener
@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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRule()voidNotify 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)
-
Constructor Details
-
MigrationRuleListener
-
-
Method Details
-
process
- Specified by:
processin interfaceConfigurationListener
-
setRawRule
-
onExport
Description copied from interface:RegistryProtocolListenerNotify RegistryProtocol's listeners when a service is registered- Specified by:
onExportin interfaceRegistryProtocolListener- Parameters:
registryProtocol- RegistryProtocol instanceexporter- exporter- See Also:
-
onRefer
public void onRefer(RegistryProtocol registryProtocol, ClusterInvoker<?> invoker, URL consumerUrl, URL registryURL) Description copied from interface:RegistryProtocolListenerNotify RegistryProtocol's listeners when a service is subscribed- Specified by:
onReferin interfaceRegistryProtocolListener- Parameters:
registryProtocol- RegistryProtocol instanceinvoker- invokerconsumerUrl-- See Also:
-
onDestroy
public void onDestroy()Description copied from interface:RegistryProtocolListenerNotify RegistryProtocol's listeners when the protocol is destroyed- Specified by:
onDestroyin interfaceRegistryProtocolListener
-
getHandlers
-
getRule
-