Class ConfigSetSubscription<T extends com.yahoo.config.ConfigInstance>
java.lang.Object
com.yahoo.config.subscription.impl.ConfigSubscription<T>
com.yahoo.config.subscription.impl.ConfigSetSubscription<T>
public class ConfigSetSubscription<T extends com.yahoo.config.ConfigInstance>
extends ConfigSubscription<T>
Subscription on a programmatically built set of configs
- Author:
- Vegard Havdal
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.config.subscription.impl.ConfigSubscription
ConfigSubscription.ConfigState<T extends com.yahoo.config.ConfigInstance>
-
Field Summary
Fields inherited from class com.yahoo.config.subscription.impl.ConfigSubscription
configClass, key, log
-
Method Summary
Modifier and TypeMethodDescriptionboolean
nextConfig
(long timeout) Polls this subscription for a change.boolean
subscribe
(long timeout) Will block until the nextConfigSubscription.nextConfig(long)
is guaranteed to return an answer (or throw) immediately (i.e.Methods inherited from class com.yahoo.config.subscription.impl.ConfigSubscription
checkReloaded, close, equals, get, getConfigClass, getConfigState, getDefContent, getException, getKey, isClosed, isConfigChangedAndReset, reload, setConfigIfChanged, setConfigIncGen, setException, toString
-
Method Details
-
nextConfig
public boolean nextConfig(long timeout) Description copied from class:ConfigSubscription
Polls this subscription for a change. The method is guaranteed to use all of the given timeout before returning false. It will also take into account a user-set generation, that can be set byConfigSubscriber.reload(long)
.- Specified by:
nextConfig
in classConfigSubscription<T extends com.yahoo.config.ConfigInstance>
- Parameters:
timeout
- in milliseconds- Returns:
- false if timed out, true if generation or config or
ConfigSubscription.exception
changed. If true, theConfigSubscription.config
field will be set also. has changed
-
subscribe
public boolean subscribe(long timeout) Description copied from class:ConfigSubscription
Will block until the nextConfigSubscription.nextConfig(long)
is guaranteed to return an answer (or throw) immediately (i.e. not block)- Specified by:
subscribe
in classConfigSubscription<T extends com.yahoo.config.ConfigInstance>
- Parameters:
timeout
- in milliseconds- Returns:
- false if timed out
-