org.jboss.cache.loader
Class LocalDelegatingCacheLoader

java.lang.Object
  extended byorg.jboss.cache.loader.DelegatingCacheLoader (src) 
      extended byorg.jboss.cache.loader.LocalDelegatingCacheLoader
All Implemented Interfaces:
CacheLoader (src) , Service (src)

public class LocalDelegatingCacheLoader
extends DelegatingCacheLoader (src)

DelegatingCacheLoader implementation which delegates to a local (in the same VM) TreeCache. Sample code:

 TreeCache firstLevel=new TreeCache();
 TreeCache secondLevel=new TreeCache();
 DelegatingCacheLoader l=new DelegatingCacheLoader(secondLevel);
 l.setCache(firstLevel);
 firstLevel.setCacheLoader(l);
 secondLevel.start();
 firstLevel.start();
 


Constructor Summary
LocalDelegatingCacheLoader(TreeCache (src)  delegate)
           
 
Method Summary
protected  boolean delegateExists(Fqn (src)  name)
           
protected  Node (src) delegateGet(Fqn (src)  name)
           
protected  java.lang.Object delegateGet(Fqn (src)  name, java.lang.Object key)
           
protected  java.util.Set delegateGetChildrenNames(Fqn (src)  fqn)
           
protected  byte[] delegateLoadEntireState()
           
protected  void delegatePut(Fqn (src)  name, java.util.Map attributes)
           
protected  java.lang.Object delegatePut(Fqn (src)  name, java.lang.Object key, java.lang.Object value)
           
protected  void delegateRemove(Fqn (src)  name)
           
protected  java.lang.Object delegateRemove(Fqn (src)  name, java.lang.Object key)
           
protected  void delegateRemoveData(Fqn (src)  name)
           
protected  void delegateStoreEntireState(byte[] state)
           
 void setCache(TreeCache (src)  cache)
          This method allows the CacheLoader to set the TreeCache, therefore allowing the CacheLoader to invoke methods of the TreeCache.
 void setConfig(java.util.Properties props)
          Sets the configuration.
 
Methods inherited from class org.jboss.cache.loader.DelegatingCacheLoader (src)
commit, create, destroy, exists, get, get, getChildrenNames, loadEntireState, prepare, put, put, put, put, remove, remove, removeData, rollback, start, stop, storeEntireState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalDelegatingCacheLoader

public LocalDelegatingCacheLoader(TreeCache (src)  delegate)
Method Detail

setConfig

public void setConfig(java.util.Properties props)
Description copied from interface: CacheLoader (src)
Sets the configuration. Will be called before Service.create() and Service.start()

Specified by:
setConfig in interface CacheLoader (src)
Specified by:
setConfig in class DelegatingCacheLoader (src)

setCache

public void setCache(TreeCache (src)  cache)
Description copied from interface: CacheLoader (src)
This method allows the CacheLoader to set the TreeCache, therefore allowing the CacheLoader to invoke methods of the TreeCache. It can also use the TreeCache to fetch configuration information. Alternatively, the CacheLoader could maintain its own configuration
This method will be called directly after the CacheLoader instance has been created

Specified by:
setCache in interface CacheLoader (src)
Specified by:
setCache in class DelegatingCacheLoader (src)

delegateGetChildrenNames

protected java.util.Set delegateGetChildrenNames(Fqn (src)  fqn)
                                          throws java.lang.Exception
Specified by:
delegateGetChildrenNames in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateGet

protected java.lang.Object delegateGet(Fqn (src)  name,
                                       java.lang.Object key)
                                throws java.lang.Exception
Specified by:
delegateGet in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateGet

protected Node (src)  delegateGet(Fqn (src)  name)
                    throws java.lang.Exception
Specified by:
delegateGet in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateExists

protected boolean delegateExists(Fqn (src)  name)
                          throws java.lang.Exception
Specified by:
delegateExists in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegatePut

protected java.lang.Object delegatePut(Fqn (src)  name,
                                       java.lang.Object key,
                                       java.lang.Object value)
                                throws java.lang.Exception
Specified by:
delegatePut in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegatePut

protected void delegatePut(Fqn (src)  name,
                           java.util.Map attributes)
                    throws java.lang.Exception
Specified by:
delegatePut in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateRemove

protected java.lang.Object delegateRemove(Fqn (src)  name,
                                          java.lang.Object key)
                                   throws java.lang.Exception
Specified by:
delegateRemove in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateRemove

protected void delegateRemove(Fqn (src)  name)
                       throws java.lang.Exception
Specified by:
delegateRemove in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateRemoveData

protected void delegateRemoveData(Fqn (src)  name)
                           throws java.lang.Exception
Specified by:
delegateRemoveData in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateLoadEntireState

protected byte[] delegateLoadEntireState()
                                  throws java.lang.Exception
Specified by:
delegateLoadEntireState in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception

delegateStoreEntireState

protected void delegateStoreEntireState(byte[] state)
                                 throws java.lang.Exception
Specified by:
delegateStoreEntireState in class DelegatingCacheLoader (src)
Throws:
java.lang.Exception