| 1 | | | |
| 2 | | | |
| 3 | | | |
| 4 | | | |
| 5 | | | |
| 6 | | | |
| 7 | | | |
| 8 | | | |
| 9 | | | |
| 10 | | | |
| 11 | | | |
| 12 | | | |
| 13 | | | |
| 14 | | | |
| 15 | | | |
| 16 | | | |
| 17 | | | |
| 18 | | | |
| 19 | | | |
| 20 | | | |
| 21 | | | |
| 22 | | | |
| 23 | | | |
| 24 | | | |
| 25 | | | |
| 26 | | | |
| 27 | | | |
| 28 | | | |
| 29 | | | |
| 30 | | | |
| 31 | | | |
| 32 | | | |
| 33 | | | package org.jcoderz.commons.config; |
| 34 | | | |
| 35 | | | import java.util.Set; |
| 36 | | | |
| 37 | | | import org.jcoderz.commons.ArgumentMalformedException; |
| 38 | | | |
| 39 | | | |
| 40 | | | /** |
| 41 | | | * ConfigurationCache Interface. |
| 42 | | | * This level is introduced to allow different cache implementations and |
| 43 | | | * backends. |
| 44 | | | * These are needed to reflect both development phases and newer technical |
| 45 | | | * approaches. |
| 46 | | | * |
| 47 | | | */ |
| 48 | | (1) | public interface ConfigurationCacheInterface |
| 49 | | | { |
| 50 | | | |
| 51 | | | /** |
| 52 | | | * Returns the String value that is associated with the given key. |
| 53 | | | * |
| 54 | | | * @param key Configuration Key as string that is the key for a stored |
| 55 | | | * configuration value. |
| 56 | | | * @return the String value that is associated with the given key. |
| 57 | | | * @throws ConfigurationValueNotFoundException in case there is no match to |
| 58 | | | * the key. |
| 59 | | | * @throws ArgumentMalformedException Is thrown to indicate the illegal use |
| 60 | | | * of a null object as input parameter. |
| 61 | | | */ |
| 62 | | | String getString (String key) |
| 63 | | | throws ConfigurationValueNotFoundException, |
| 64 | | | ArgumentMalformedException; |
| 65 | | | |
| 66 | | | |
| 67 | | | /** |
| 68 | | | * Returns an immutable Set containing all keys present in the |
| 69 | | | * configuration. The keys are <code>ConfigurationKey</code> objects. |
| 70 | | | * In case there are no keys, the Set is empty. |
| 71 | | | * |
| 72 | | | * @return the Set of all existing <code>ConfigurationKey</code> objects. |
| 73 | | | */ |
| 74 | | | Set getKeys (); |
| 75 | | | |
| 76 | | | /** |
| 77 | | | * @see ConfigurationServiceInterface#addConfigurationListener(ConfigurationListener) |
| 78 | | | */ |
| 79 | | (2) | void addConfigurationListener (ConfigurationListener (2)newListener); |
| 80 | | | |
| 81 | | | /** |
| 82 | | | * Reloads the internal configuration cache from resource bundle. |
| 83 | | | * If an exception occurs during the reload, the old cached properties are |
| 84 | | | * returned. |
| 85 | | | */ |
| 86 | | | void reloadCache (); |
| 87 | | | } |
| 88 | | | |