public abstract class AbstractConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>> extends Object implements ConfigurationRepository<T,Loader,Writer>
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
inited |
protected Loader |
loader |
protected String |
name |
protected boolean |
running |
protected Writer |
writer |
| 构造器和说明 |
|---|
AbstractConfigurationRepository() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(T configuration)
Add a configuration to the repository
it equals:
add(T configuration, true) |
void |
add(T configuration,
boolean sync) |
Map<String,T> |
getAll() |
T |
getById(String id)
Get a configuration bean by a specified id
|
EventPublisher |
getEventPublisher() |
void |
init() |
void |
removeById(String id)
Remove a configuration by id
it equals:
removeById(T configuration, true) |
void |
removeById(String id,
boolean sync)
Remove a configuration by id
|
void |
setCache(Cache<String,T> cache) |
void |
setConfigurationLoader(Loader loader)
set a loader
|
void |
setConfigurationWriter(Writer writer)
set a writer
|
void |
setEventFactory(ConfigurationEventFactory<T> eventFactory) |
void |
setEventPublisher(EventPublisher publisher) |
void |
setName(String name) |
void |
shutdown() |
void |
startup() |
void |
update(T configuration)
update the configuration to storage
it equals:
update(T configuration, true) |
void |
update(T configuration,
boolean sync)
update the configuration to storage
|
@NonNull protected Loader extends ConfigurationLoader<T> loader
@Nullable protected Writer extends ConfigurationWriter<T> writer
protected volatile boolean inited
protected volatile boolean running
public void setName(String name)
public void setEventFactory(ConfigurationEventFactory<T> eventFactory)
public EventPublisher getEventPublisher()
getEventPublisher 在接口中 EventPublisherAwarepublic void setEventPublisher(EventPublisher publisher)
setEventPublisher 在接口中 EventPublisherAwarepublic void setConfigurationLoader(Loader loader)
ConfigurationRepositorysetConfigurationLoader 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>loader - the configuration loaderpublic void setConfigurationWriter(Writer writer)
ConfigurationRepositorysetConfigurationWriter 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>writer - the configuration writerpublic T getById(String id)
ConfigurationRepositorygetById 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>id - the idpublic void removeById(String id)
ConfigurationRepositoryremoveById(T configuration, true)removeById 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>id - the configuration idpublic void removeById(String id, boolean sync)
ConfigurationRepositoryremoveById 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>id - the configuration idsync - whether sync to the real storage or notpublic void add(T configuration)
ConfigurationRepositoryadd(T configuration, true)add 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>configuration - the configuration beanpublic void add(T configuration, boolean sync)
add 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>configuration - the configurationsync - whether sync to the real storage or notpublic void update(T configuration)
ConfigurationRepositoryupdate(T configuration, true)update 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>configuration - the configuration beanpublic void update(T configuration, boolean sync)
ConfigurationRepositoryupdate 在接口中 ConfigurationRepository<T extends Configuration,Loader extends ConfigurationLoader<T>,Writer extends ConfigurationWriter<T>>configuration - the configuration beansync - whether sync to the real storage or notpublic void init()
throws InitializationException
init 在接口中 InitializableInitializationExceptionCopyright © 2019. All rights reserved.