org.jboss.cache.loader
Class RpcDelegatingCacheLoader

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

public class RpcDelegatingCacheLoader
extends DelegatingCacheLoader

DelegatingCacheLoader implementation which delegates to a remote (not in the same VM) TreeCache using JGroups' RPC mechanism. The remote TreeCache delegated to is this cacheloader's cache's coordinator. This CacheLoader uses an optional configuration property, timeout, which specifies the timeout in milliseconds for each RPC call. If timeout is not specified, it defaults to 5000.

Version:
$Id: RpcDelegatingCacheLoader.java,v 1.4.2.1 2005/04/04 05:44:19 bwang00 Exp $
Author:
Daniel Gredler

Field Summary
static Method METHOD_EXISTS
           
static Method METHOD_GET_CHILDREN_NAMES
           
static Method METHOD_GET_STATE
           
static Method METHOD_GET_WITH_1_PARAM
           
static Method METHOD_GET_WITH_2_PARAMS
           
static Method METHOD_PUT_WITH_2_PARAMS
           
static Method METHOD_PUT_WITH_3_PARAMS
           
static Method METHOD_REMOVE_DATA
           
static Method METHOD_REMOVE_WITH_1_PARAM
           
static Method METHOD_REMOVE_WITH_2_PARAMS
           
static Method METHOD_SET_STATE
           
 
Constructor Summary
RpcDelegatingCacheLoader()
          Default constructor.
RpcDelegatingCacheLoader(TreeCache cache, int timeout)
          Allows programmatic configuration.
 
Method Summary
protected  boolean delegateExists(Fqn name)
           
protected  Node delegateGet(Fqn name)
           
protected  Object delegateGet(Fqn name, Object key)
           
protected  Set delegateGetChildrenNames(Fqn name)
           
 byte[] delegateLoadEntireState()
           
protected  void delegatePut(Fqn name, Map attributes)
           
protected  Object delegatePut(Fqn name, Object key, Object value)
           
protected  void delegateRemove(Fqn name)
           
protected  Object delegateRemove(Fqn name, Object key)
           
protected  void delegateRemoveData(Fqn name)
           
 void delegateStoreEntireState(byte[] state)
           
 void setCache(TreeCache cache)
          Allows configuration via XML config file.
 void setConfig(Properties props)
          Allows configuration via XML config file.
 
Methods inherited from class org.jboss.cache.loader.DelegatingCacheLoader
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
 

Field Detail

METHOD_GET_STATE

public static Method METHOD_GET_STATE

METHOD_SET_STATE

public static Method METHOD_SET_STATE

METHOD_GET_CHILDREN_NAMES

public static Method METHOD_GET_CHILDREN_NAMES

METHOD_GET_WITH_2_PARAMS

public static Method METHOD_GET_WITH_2_PARAMS

METHOD_GET_WITH_1_PARAM

public static Method METHOD_GET_WITH_1_PARAM

METHOD_EXISTS

public static Method METHOD_EXISTS

METHOD_PUT_WITH_3_PARAMS

public static Method METHOD_PUT_WITH_3_PARAMS

METHOD_PUT_WITH_2_PARAMS

public static Method METHOD_PUT_WITH_2_PARAMS

METHOD_REMOVE_WITH_2_PARAMS

public static Method METHOD_REMOVE_WITH_2_PARAMS

METHOD_REMOVE_WITH_1_PARAM

public static Method METHOD_REMOVE_WITH_1_PARAM

METHOD_REMOVE_DATA

public static Method METHOD_REMOVE_DATA
Constructor Detail

RpcDelegatingCacheLoader

public RpcDelegatingCacheLoader()
Default constructor.


RpcDelegatingCacheLoader

public RpcDelegatingCacheLoader(TreeCache cache,
                                int timeout)
Allows programmatic configuration.

Parameters:
timeout - The timeout in milliseconds for each RPC call.
Method Detail

setConfig

public void setConfig(Properties props)
Allows configuration via XML config file.

Specified by:
setConfig in interface CacheLoader
Specified by:
setConfig in class DelegatingCacheLoader
See Also:
DelegatingCacheLoader.setConfig(java.util.Properties)

setCache

public void setCache(TreeCache cache)
Allows configuration via XML config file.

Specified by:
setCache in interface CacheLoader
Specified by:
setCache in class DelegatingCacheLoader
See Also:
DelegatingCacheLoader.setCache(org.jboss.cache.TreeCache)

delegateGetChildrenNames

protected Set delegateGetChildrenNames(Fqn name)
                                throws Exception
Specified by:
delegateGetChildrenNames in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateGetChildrenNames(org.jboss.cache.Fqn)

delegateGet

protected Object delegateGet(Fqn name,
                             Object key)
                      throws Exception
Specified by:
delegateGet in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateGet(org.jboss.cache.Fqn, java.lang.Object)

delegateGet

protected Node delegateGet(Fqn name)
                    throws Exception
Specified by:
delegateGet in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateGet(org.jboss.cache.Fqn)

delegateExists

protected boolean delegateExists(Fqn name)
                          throws Exception
Specified by:
delegateExists in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateExists(org.jboss.cache.Fqn)

delegatePut

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

delegatePut

protected void delegatePut(Fqn name,
                           Map attributes)
                    throws Exception
Specified by:
delegatePut in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegatePut(org.jboss.cache.Fqn, java.util.Map)

delegateRemove

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

delegateRemove

protected void delegateRemove(Fqn name)
                       throws Exception
Specified by:
delegateRemove in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateRemove(org.jboss.cache.Fqn)

delegateRemoveData

protected void delegateRemoveData(Fqn name)
                           throws Exception
Specified by:
delegateRemoveData in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateRemoveData(org.jboss.cache.Fqn)

delegateLoadEntireState

public byte[] delegateLoadEntireState()
                               throws Exception
Specified by:
delegateLoadEntireState in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateLoadEntireState()

delegateStoreEntireState

public void delegateStoreEntireState(byte[] state)
                              throws Exception
Specified by:
delegateStoreEntireState in class DelegatingCacheLoader
Throws:
Exception
See Also:
DelegatingCacheLoader.delegateStoreEntireState(byte[])


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.