org.jboss.cache.loader
Class LocalDelegatingCacheLoader

java.lang.Object
  extended by org.jboss.cache.loader.DelegatingCacheLoader
      extended by org.jboss.cache.loader.LocalDelegatingCacheLoader
All Implemented Interfaces:
CacheLoader, org.jboss.system.Service

public class LocalDelegatingCacheLoader
extends DelegatingCacheLoader

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();
 

Version:
$Id: LocalDelegatingCacheLoader.java,v 1.7 2006/01/17 13:35:36 bela Exp $
Author:
Bela Ban, Daniel Gredler

Field Summary
 
Fields inherited from class org.jboss.cache.loader.DelegatingCacheLoader
delegateExists, delegateGet, delegateGetChildrenNames, delegateGetKey, delegateLoadEntireState, delegatePut, delegatePutKeyVal, delegateRemove, delegateRemoveData, delegateRemoveKey, delegateStoreEntireState, putList
 
Constructor Summary
LocalDelegatingCacheLoader()
           
LocalDelegatingCacheLoader(TreeCache delegate)
           
 
Method Summary
protected  boolean delegateExists(Fqn name)
           
protected  java.util.Map delegateGet(Fqn name)
           
protected  java.util.Set delegateGetChildrenNames(Fqn fqn)
           
protected  byte[] delegateLoadEntireState()
           
protected  void delegatePut(Fqn name, java.util.Map attributes)
           
protected  java.lang.Object delegatePut(Fqn name, java.lang.Object key, java.lang.Object value)
           
protected  void delegatePut(java.util.List modifications)
           
protected  void delegateRemove(Fqn name)
           
protected  java.lang.Object delegateRemove(Fqn name, java.lang.Object key)
           
protected  void delegateRemoveData(Fqn name)
           
protected  void delegateStoreEntireState(byte[] state)
           
 void setCache(TreeCache cache)
          Sets the TreeCache that is maintaining this CacheLoader.
 void setConfig(java.util.Properties props)
          Sets the configuration.
protected  void setDelegateCache(TreeCache delegate)
           
 
Methods inherited from class org.jboss.cache.loader.DelegatingCacheLoader
commit, create, destroy, exists, 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()

LocalDelegatingCacheLoader

public LocalDelegatingCacheLoader(TreeCache delegate)
Method Detail

setConfig

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

Specified by:
setConfig in interface CacheLoader
Specified by:
setConfig in class DelegatingCacheLoader
Parameters:
props - a collection of configuration properties

setCache

public void setCache(TreeCache cache)
Description copied from interface: CacheLoader
Sets the TreeCache that is maintaining this CacheLoader. This method allows this CacheLoader to invoke methods on TreeCache, including fetching additional configuration information. This method is called be called after the CacheLoader instance has been constructed.

Specified by:
setCache in interface CacheLoader
Specified by:
setCache in class DelegatingCacheLoader
Parameters:
cache - The cache on which this loader works

delegateGetChildrenNames

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

delegateGet

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

setDelegateCache

protected void setDelegateCache(TreeCache delegate)

delegateExists

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

delegatePut

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

delegatePut

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

delegatePut

protected void delegatePut(java.util.List modifications)
                    throws java.lang.Exception
Specified by:
delegatePut in class DelegatingCacheLoader
Throws:
java.lang.Exception

delegateRemove

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

delegateRemove

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

delegateRemoveData

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

delegateLoadEntireState

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

delegateStoreEntireState

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


Copyright 1998-2005 JBoss Inc . All Rights Reserved.