|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openwms.core.integration.file.PreferencesDaoImpl
@Repository(value="preferencesFileDao") public final class PreferencesDaoImpl
A PreferencesDaoImpl reads a XML file of preferences and keeps them internally in a Map. An initial preferences file is expected to be at "classpath:org/openwms/core/integration/file/initial-preferences.xml" but this can be overridden with a property application.initial.properties in the configuration properties file.
On a PropertiesChangedEvent
the internal Map is cleared and reloaded.
PropertiesChangedEvent
Field Summary | |
---|---|
static String |
INITIAL_PREFERENCES_FILE
The URL to the initial preferences XML file. |
Method Summary | ||
---|---|---|
List<AbstractPreference> |
findAll()
Find all entities and return them as a List . |
|
AbstractPreference |
findByKey(PreferenceKey id)
Find and return the entity identified by the natural unique key. |
|
|
findByType(Class<T> clazz)
Find all preferences of a particular type. |
|
void |
onApplicationEvent(PropertiesChangedEvent event)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String INITIAL_PREFERENCES_FILE
Method Detail |
---|
public AbstractPreference findByKey(PreferenceKey id)
findByKey
in interface PreferenceDao<PreferenceKey>
id
- Natural key to find the entity (also known as business key)
PreferenceDao.findByKey(java.io.Serializable)
public <T extends AbstractPreference> List<T> findByType(Class<T> clazz)
findByType
in interface PreferenceDao<PreferenceKey>
T
- Any subtype of AbstractPreference
clazz
- The type to search for
PreferenceDao.findByType(Class)
public List<AbstractPreference> findAll()
List
.
findAll
in interface PreferenceDao<PreferenceKey>
PreferenceDao.findAll()
public void onApplicationEvent(PropertiesChangedEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<PropertiesChangedEvent>
ApplicationListener.onApplicationEvent(org.springframework.context.ApplicationEvent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |