public abstract class AbstractConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>> extends BaseConfigurationRepository<T,Loader,Writer>
| 限定符和类型 | 字段和说明 |
|---|---|
protected Cache<String,T> |
cache |
protected int |
reloadIntervalInSeconds
units: seconds
scan interval, if <=0, will not refresh
|
comparator, eventFactory, eventPublisher, loader, writerinited| 构造器和说明 |
|---|
AbstractConfigurationRepository() |
| 限定符和类型 | 方法和说明 |
|---|---|
T |
add(T configuration,
boolean sync) |
protected void |
doInit() |
protected void |
doStart()
Subclasses must implement this method with the start behavior.
|
protected void |
doStop()
Subclasses must implement this method with the stop behavior.
|
Map<String,T> |
getAll() |
T |
getById(String id)
Get a configuration bean by a specified id
|
Timer |
getTimer() |
void |
removeById(String id,
boolean sync)
Remove a configuration by id
|
void |
setCache(Cache<String,T> cache) |
void |
setReloadIntervalInSeconds(int reloadIntervalInSeconds) |
void |
setTimer(Timer timer) |
void |
update(T configuration,
boolean sync)
update the configuration to storage
|
add, getComparator, getConfigurationLoader, getConfigurationWriter, getEventPublisher, logMutation, reload, removeById, setComparator, setConfigurationLoader, setConfigurationWriter, setEventFactory, setEventPublisher, updategetName, isRunning, setName, shutdown, startup, stopAndExecute, toStringinitclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, setNameinit@NonNull protected Cache<String,T extends Configuration> cache
protected int reloadIntervalInSeconds
public void setReloadIntervalInSeconds(int reloadIntervalInSeconds)
public Timer getTimer()
public void setTimer(Timer timer)
protected void doStart()
AbstractLifecycleAbstractLifecycle.lifecycleLock.doStart 在类中 AbstractLifecycleprotected void doStop()
AbstractLifecycleAbstractLifecycle.lifecycleLock.doStop 在类中 BaseConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>public T getById(String id)
ConfigurationRepositoryid - the idpublic void removeById(String id, boolean sync)
ConfigurationRepositoryid - the configuration idsync - whether sync to the real storage or notpublic T add(T configuration, boolean sync)
configuration - the configurationsync - whether sync to the real storage or notpublic void update(T configuration, boolean sync)
ConfigurationRepositoryconfiguration - the configuration beansync - whether sync to the real storage or notprotected void doInit()
doInit 在类中 BaseConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>Copyright © 2022. All rights reserved.