org.jboss.cache.interceptors
Class DataGravitatorInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.MethodDispacherInterceptor
          extended by org.jboss.cache.interceptors.BaseRpcInterceptor
              extended by org.jboss.cache.interceptors.DataGravitatorInterceptor
All Implemented Interfaces:
InterceptorMBean

public class DataGravitatorInterceptor
extends BaseRpcInterceptor

The Data Gravitator interceptor intercepts cache misses and attempts to gravitate data from other parts of the cluster.

Only used if Buddy Replication is enabled. Also, the interceptor only kicks in if an Option is passed in to force Data Gravitation for a specific invocation or if autoDataGravitation is set to true when configuring Buddy Replication.

See the JBoss Cache User Guide for more details on configuration options. There is a section dedicated to Buddy Replication in the Replication chapter.

Author:
Manik Surtani (manik@jboss.org)

Nested Class Summary
static class DataGravitatorInterceptor.ResponseValidityFilter
           
 
Field Summary
 
Fields inherited from class org.jboss.cache.interceptors.BaseRpcInterceptor
defaultSynchronous
 
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next, trace
 
Constructor Summary
DataGravitatorInterceptor()
           
 
Method Summary
protected  Object handleCommitMethod(InvocationContext ctx, GlobalTransaction globalTransaction)
          Handles CacheImpl.commit(org.jboss.cache.transaction.GlobalTransaction)
protected  Object handleExistsMethod(InvocationContext ctx, Fqn fqn)
          Handles CacheImpl.exists(String)
protected  Object handleGetDataMapMethod(InvocationContext ctx, Fqn fqn)
          Handles CacheImpl._getData(org.jboss.cache.Fqn)
protected  Object handleGetChildrenNamesMethod(InvocationContext ctx, Fqn fqn)
          Handles CacheImpl._getChildrenNames(org.jboss.cache.Fqn)
protected  Object handleGetKeysMethod(InvocationContext ctx, Fqn fqn)
          Handles Cache.getKeys(Fqn)
protected  Object handleGetKeyValueMethod(InvocationContext ctx, Fqn fqn, Object key, boolean sendNodeEvent)
          Handles CacheImpl._get(org.jboss.cache.Fqn, Object, boolean)
protected  Object handleGetNodeMethod(InvocationContext ctx, Fqn fqn)
          Handles CacheImpl._get(org.jboss.cache.Fqn)
protected  Object handleOptimisticPrepareMethod(InvocationContext ctx, GlobalTransaction gtx, List modifications, Map data, org.jgroups.Address address, boolean onePhaseCommit)
          Handles CacheImpl.optimisticPrepare(org.jboss.cache.transaction.GlobalTransaction, java.util.List, java.util.Map, org.jgroups.Address, boolean)
protected  Object handlePrepareMethod(InvocationContext ctx, GlobalTransaction gtx, List modification, org.jgroups.Address coordinator, boolean onePhaseCommit)
          Handles CacheImpl.prepare(org.jboss.cache.transaction.GlobalTransaction, java.util.List, org.jgroups.Address, boolean)
protected  Object handleRollbackMethod(InvocationContext ctx, GlobalTransaction globalTransaction)
          Handles CacheImpl.rollback(org.jboss.cache.transaction.GlobalTransaction)
 void setCache(CacheSPI cache)
           
protected  boolean skipMethodCall(InvocationContext ctx)
          Each interceptor should extend this if it does not need any processing for current call.
 
Methods inherited from class org.jboss.cache.interceptors.BaseRpcInterceptor
containsModifications, checkResponses, isSynchronous, isTransactionalAndLocal, putCallOnAsyncReplicationQueue, replicateCall, replicateCall, replicateCall, replicateCall, skipReplicationOfTransactionMethod
 
Methods inherited from class org.jboss.cache.interceptors.MethodDispacherInterceptor
handleAddChildMethod, handleBlockChannelMethod, handleDataGravitationCleanupMethod, handleEvictMethod, handleEvictVersionedNodeMethod, handleLockMethod, handleMoveMethod, handlePrintMethod, handlePutDataEraseMethod, handlePutDataEraseVersionedMethod, handlePutDataMethod, handlePutDataVersionedMethod, handlePutForExternalReadMethod, handlePutForExternalReadVersionedMethod, handlePutKeyValueMethod, handlePutKeyValueVersionedMethod, handleReleaseAllLocksMethod, handleRemoveDataMethod, handleRemoveDataVersionedMethod, handleRemoveKeyMethod, handleRemoveKeyVersionedMethod, handleRemoveNodeMethod, handleRemoveNodeVersionedMethod, handleUnblockChannelMethod, invoke
 
Methods inherited from class org.jboss.cache.interceptors.Interceptor
assertTransactionValid, dumpStatistics, getLast, getNext, getStatisticsEnabled, initLogger, isActive, isPreparing, isValid, nextInterceptor, peekNode, resetStatistics, setLast, setNext, setStatisticsEnabled, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataGravitatorInterceptor

public DataGravitatorInterceptor()
Method Detail

setCache

public void setCache(CacheSPI cache)
Overrides:
setCache in class BaseRpcInterceptor

skipMethodCall

protected boolean skipMethodCall(InvocationContext ctx)
Description copied from class: MethodDispacherInterceptor
Each interceptor should extend this if it does not need any processing for current call. An sample usage would be: this interceptor is only interested if thre is one transaction going on. If so all handleXYZ would know that we have a transaction going and would not check its state.

Overrides:
skipMethodCall in class MethodDispacherInterceptor

handleGetChildrenNamesMethod

protected Object handleGetChildrenNamesMethod(InvocationContext ctx,
                                              Fqn fqn)
                                       throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._getChildrenNames(org.jboss.cache.Fqn)

Overrides:
handleGetChildrenNamesMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleGetDataMapMethod

protected Object handleGetDataMapMethod(InvocationContext ctx,
                                        Fqn fqn)
                                 throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._getData(org.jboss.cache.Fqn)

Overrides:
handleGetDataMapMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleExistsMethod

protected Object handleExistsMethod(InvocationContext ctx,
                                    Fqn fqn)
                             throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl.exists(String)

Overrides:
handleExistsMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleGetKeysMethod

protected Object handleGetKeysMethod(InvocationContext ctx,
                                     Fqn fqn)
                              throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles Cache.getKeys(Fqn)

Overrides:
handleGetKeysMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleGetKeyValueMethod

protected Object handleGetKeyValueMethod(InvocationContext ctx,
                                         Fqn fqn,
                                         Object key,
                                         boolean sendNodeEvent)
                                  throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._get(org.jboss.cache.Fqn, Object, boolean)

Overrides:
handleGetKeyValueMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleGetNodeMethod

protected Object handleGetNodeMethod(InvocationContext ctx,
                                     Fqn fqn)
                              throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._get(org.jboss.cache.Fqn)

Overrides:
handleGetNodeMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePrepareMethod

protected Object handlePrepareMethod(InvocationContext ctx,
                                     GlobalTransaction gtx,
                                     List modification,
                                     org.jgroups.Address coordinator,
                                     boolean onePhaseCommit)
                              throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl.prepare(org.jboss.cache.transaction.GlobalTransaction, java.util.List, org.jgroups.Address, boolean)

Overrides:
handlePrepareMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleOptimisticPrepareMethod

protected Object handleOptimisticPrepareMethod(InvocationContext ctx,
                                               GlobalTransaction gtx,
                                               List modifications,
                                               Map data,
                                               org.jgroups.Address address,
                                               boolean onePhaseCommit)
                                        throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl.optimisticPrepare(org.jboss.cache.transaction.GlobalTransaction, java.util.List, java.util.Map, org.jgroups.Address, boolean)

Overrides:
handleOptimisticPrepareMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleRollbackMethod

protected Object handleRollbackMethod(InvocationContext ctx,
                                      GlobalTransaction globalTransaction)
                               throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl.rollback(org.jboss.cache.transaction.GlobalTransaction)

Overrides:
handleRollbackMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleCommitMethod

protected Object handleCommitMethod(InvocationContext ctx,
                                    GlobalTransaction globalTransaction)
                             throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl.commit(org.jboss.cache.transaction.GlobalTransaction)

Overrides:
handleCommitMethod in class MethodDispacherInterceptor
Throws:
Throwable


Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.