V
- type of configuration beanpublic class ConfigReloadContainer<V> extends Object implements ReloadingContainer<V>, RegistrationListener<ConfigurationProvider>
ConfigurationProvider
.Modifier and Type | Class and Description |
---|---|
static class |
ConfigReloadContainer.Builder<V> |
Modifier and Type | Method and Description |
---|---|
Long |
getLastUpdate()
Retrieve the time at which the object was last updated.
|
V |
getObject()
Retrieve the object held by the container.
|
void |
providerRegistered(Registration registration,
ConfigurationProvider provider)
providerRegistered
|
void |
providerUnregistered(Registration registration,
ConfigurationProvider provider)
providerUnregistered
|
void |
reload()
Immediately reload the object.
|
void |
setReloadCheckInterval(Long reloadCheckInterval)
Set the frequency at which the object should be checked for updates.
|
public V getObject()
ReloadingContainer
getObject
in interface ReloadingContainer<V>
public void reload()
ReloadingContainer
ReloadingContainer.getObject()
will return the updated object.reload
in interface ReloadingContainer<V>
public void setReloadCheckInterval(Long reloadCheckInterval)
ReloadingContainer
ReloadingContainer.getObject()
are made once the interval has passed.setReloadCheckInterval
in interface ReloadingContainer<V>
reloadCheckInterval
- interval in ms, if null
the default value will be used, if <= 0 reload checks will be disabledpublic Long getLastUpdate()
ReloadingContainer
getLastUpdate
in interface ReloadingContainer<V>
public void providerRegistered(Registration registration, ConfigurationProvider provider)
RegistrationListener
providerRegistered
providerRegistered
in interface RegistrationListener<ConfigurationProvider>
registration
- a Registration
object.provider
- a T object.public void providerUnregistered(Registration registration, ConfigurationProvider provider)
RegistrationListener
providerUnregistered
providerUnregistered
in interface RegistrationListener<ConfigurationProvider>
registration
- a Registration
object.provider
- a T object.Copyright © 2020. All rights reserved.