org.jboss.shotoku.cache
Class ShotokuPropertiesWatcher<K>

java.lang.Object
  extended by org.jboss.shotoku.cache.ShotokuCacheItem<K,T>
      extended by org.jboss.shotoku.cache.ShotokuResourceWatcher<K,java.util.Properties>
          extended by org.jboss.shotoku.cache.ShotokuPropertiesWatcher<K>

public abstract class ShotokuPropertiesWatcher<K>
extends ShotokuResourceWatcher<K,java.util.Properties>

Author:
Adam Warski (adamw@aster.pl)

Constructor Summary
ShotokuPropertiesWatcher()
           
 
Method Summary
protected abstract  java.lang.String getConfigFileName()
           
 java.util.Properties init(K key)
          Called when the user demanded an object which hasn't been accessed before, and thus, which hasn't been yet initialized.
protected  void update(K key, java.util.Properties currentObject, java.util.Map<java.lang.String,ChangeType> changes)
          Same as ShotokuCacheItem.update(String, T), but is called only when some of the watched resources change, not on each call of update by the service.
 
Methods inherited from class org.jboss.shotoku.cache.ShotokuResourceWatcher
addWatchedPath, deleteWatchedPath, resetWatchedPaths, update
 
Methods inherited from class org.jboss.shotoku.cache.ShotokuCacheItem
get, getContentManager, initContentManager, put, remove, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShotokuPropertiesWatcher

public ShotokuPropertiesWatcher()
Method Detail

getConfigFileName

protected abstract java.lang.String getConfigFileName()

init

public java.util.Properties init(K key)
Description copied from class: ShotokuCacheItem
Called when the user demanded an object which hasn't been accessed before, and thus, which hasn't been yet initialized. Here, put(key, initialObject) should not be called, as the returned object is automatically placed in the cache.

Specified by:
init in class ShotokuCacheItem<K,java.util.Properties>
Parameters:
key - Key of the object to initialize.
Returns:
Initial value of an object with the given key.

update

protected void update(K key,
                      java.util.Properties currentObject,
                      java.util.Map<java.lang.String,ChangeType> changes)
Description copied from class: ShotokuResourceWatcher
Same as ShotokuCacheItem.update(String, T), but is called only when some of the watched resources change, not on each call of update by the service. If the object in the cache should be changed, the implementing method must call put(key, newObject).

Specified by:
update in class ShotokuResourceWatcher<K,java.util.Properties>
Parameters:
key - Key of the object to update.
currentObject - Current value held in the cache.
changes - A map of descripiton of changes that occured since last update.


Copyright © -2006 . All Rights Reserved.