The railo.commons.io.cache.Cache interface declares that most methods can throw IOExceptions, however a handful of methods cannot throw. Namely:
- getCacheEntry(String key,CacheEntry defaultValue) (However, getCacheEntry(String key) DOES throw IOException)
- getValue(String key,Object defaultValue) (However, getValue(String key) DOES throw IOException)
- put(String key, Object value,Long idleTime,Long until)
- contains(String key)
The main concern is that if there is an error in the underlying cache engine and user code trying to, say, set an item into the cache--- I have no way in my code to notify that something went horribly wrong and nothing was set since I'm not allowed to throw an error. I can log the error, but that provides no feedback and the application will assume that the cache is behaving normally.
I suggest that the methods above be allowed to throw an IOException to allow me to write a cache extension that is capable of notifying the application when/if a fatal error has occurred while trying to access the underlying cache engine.