@Retention(value=RUNTIME) @Target(value=METHOD) @Documented public @interface ApolloConfigChangeListener
Usage example:
//Listener on namespaces of "someNamespace" and "anotherNamespace", will be notified when any key is changed
@ApolloConfigChangeListener({"someNamespace","anotherNamespace"})
private void onChange(ConfigChangeEvent changeEvent) {
//handle change event
}
//Listener on namespaces of "someNamespace" and "anotherNamespace", will only be notified when "someKey" or "anotherKey" is changed
@ApolloConfigChangeListener(value = {"someNamespace","anotherNamespace"}, interestedKeys = {"someKey", "anotherKey"})
private void onChange(ConfigChangeEvent changeEvent) {
//handle change event
}
| Modifier and Type | Optional Element and Description |
|---|---|
String[] |
interestedKeys
The keys interested by the listener, will only be notified if any of the interested keys is changed.
|
String[] |
value
Apollo namespace for the config, if not specified then default to application
|
public abstract String[] value
public abstract String[] interestedKeys
Copyright © 2018 Ctrip, Inc.. All rights reserved.