org.jboss.cache.interceptors
Class BaseRpcInterceptor

java.lang.Object
  extended by org.jboss.cache.commands.AbstractVisitor
      extended by org.jboss.cache.interceptors.base.CommandInterceptor
          extended by org.jboss.cache.interceptors.BaseRpcInterceptor
All Implemented Interfaces:
Visitor, InterceptorMBean
Direct Known Subclasses:
DataGravitatorInterceptor, InvalidationInterceptor, OptimisticReplicationInterceptor, ReplicationInterceptor

public abstract class BaseRpcInterceptor
extends CommandInterceptor

Acts as a base for all RPC calls - subclassed by ReplicationInterceptor and OptimisticReplicationInterceptor.

Author:
Manik Surtani (manik@jboss.org)

Field Summary
protected  boolean defaultSynchronous
           
protected  RPCManager rpcManager
           
protected  TransactionTable txTable
           
 
Fields inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
BaseRpcInterceptor()
           
 
Method Summary
protected  void checkResponses(List rsps)
          Checks whether any of the responses are exceptions.
 void injectComponents(RPCManager rpcManager, BuddyManager buddyManager, ReplicationQueue replicationQueue, TransactionTable txTable, CommandsFactory commandsFactory)
           
protected  boolean isSynchronous(Option option)
           
protected  boolean isTransactionalAndLocal(InvocationContext ctx)
          The call runs in a transaction and it was initiated on this node of the cluster.
protected  void replicateCall(InvocationContext ctx, ReplicableCommand call, boolean sync, Option o)
           
protected  void replicateCall(InvocationContext ctx, ReplicableCommand call, boolean sync, Option o, boolean useOutOfBandMessage)
           
protected  void replicateCall(InvocationContext ctx, Vector<org.jgroups.Address> recipients, ReplicableCommand c, boolean sync, Option o, boolean useOutOfBandMessage)
           
protected  void replicateCall(Vector<org.jgroups.Address> recipients, ReplicableCommand call, boolean sync, boolean wrapCacheCommandInReplicateMethod, boolean useOutOfBandMessage, boolean isBroadcast, long timeout)
           
protected  boolean skipReplicationOfTransactionMethod(InvocationContext ctx)
          It does not make sense replicating a transaction method(commit, rollback, prepare) if one of the following is true:
 
Methods inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
dumpStatistics, getNext, getStatisticsEnabled, handleDefault, hasNext, invokeNextInterceptor, resetStatistics, setNext, setStatisticsEnabled
 
Methods inherited from class org.jboss.cache.commands.AbstractVisitor
visitCollection, visitCommitCommand, visitCreateNodeCommand, visitEvictFqnCommand, visitExistsNodeCommand, visitGetChildrenNamesCommand, visitGetDataMapCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand, visitOptimisticPrepareCommand, visitPrepareCommand, visitPutDataMapCommand, visitPutKeyValueCommand, visitRemoveDataCommand, visitRemoveKeyCommand, visitRemoveNodeCommand, visitRollbackCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

txTable

protected TransactionTable txTable

rpcManager

protected RPCManager rpcManager

defaultSynchronous

protected boolean defaultSynchronous
Constructor Detail

BaseRpcInterceptor

public BaseRpcInterceptor()
Method Detail

injectComponents

public void injectComponents(RPCManager rpcManager,
                             BuddyManager buddyManager,
                             ReplicationQueue replicationQueue,
                             TransactionTable txTable,
                             CommandsFactory commandsFactory)

checkResponses

protected void checkResponses(List rsps)
                       throws Throwable
Checks whether any of the responses are exceptions. If yes, re-throws them (as exceptions or runtime exceptions).

Throws:
Throwable

replicateCall

protected void replicateCall(InvocationContext ctx,
                             ReplicableCommand call,
                             boolean sync,
                             Option o,
                             boolean useOutOfBandMessage)
                      throws Throwable
Throws:
Throwable

replicateCall

protected void replicateCall(InvocationContext ctx,
                             ReplicableCommand call,
                             boolean sync,
                             Option o)
                      throws Throwable
Throws:
Throwable

replicateCall

protected void replicateCall(InvocationContext ctx,
                             Vector<org.jgroups.Address> recipients,
                             ReplicableCommand c,
                             boolean sync,
                             Option o,
                             boolean useOutOfBandMessage)
                      throws Throwable
Throws:
Throwable

replicateCall

protected void replicateCall(Vector<org.jgroups.Address> recipients,
                             ReplicableCommand call,
                             boolean sync,
                             boolean wrapCacheCommandInReplicateMethod,
                             boolean useOutOfBandMessage,
                             boolean isBroadcast,
                             long timeout)
                      throws Throwable
Throws:
Throwable

skipReplicationOfTransactionMethod

protected boolean skipReplicationOfTransactionMethod(InvocationContext ctx)
It does not make sense replicating a transaction method(commit, rollback, prepare) if one of the following is true:
    - call was not initiated here, but on other member of the cluster
    - there is no transaction. Why broadcast a commit or rollback if there is no transaction going on?
    - the current transaction did not modify any data
 


isTransactionalAndLocal

protected boolean isTransactionalAndLocal(InvocationContext ctx)
The call runs in a transaction and it was initiated on this node of the cluster.


isSynchronous

protected boolean isSynchronous(Option option)


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