org.jboss.cache.marshall
Class CommandAwareRpcDispatcher

java.lang.Object
  extended by org.jgroups.blocks.MessageDispatcher
      extended by org.jgroups.blocks.RpcDispatcher
          extended by org.jboss.cache.marshall.CommandAwareRpcDispatcher
All Implemented Interfaces:
org.jgroups.blocks.RequestHandler, org.jgroups.ChannelListener
Direct Known Subclasses:
InactiveRegionAwareRpcDispatcher

public class CommandAwareRpcDispatcher
extends org.jgroups.blocks.RpcDispatcher

A JGroups RPC dispatcher that knows how to deal with ReplicableCommands.

Since:
2.2.0
Author:
Manik Surtani (manik AT jboss DOT org)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jgroups.blocks.RpcDispatcher
org.jgroups.blocks.RpcDispatcher.Marshaller, org.jgroups.blocks.RpcDispatcher.Marshaller2, org.jgroups.blocks.RpcDispatcher.MarshallerAdapter
 
Field Summary
protected  ComponentRegistry componentRegistry
           
protected  InterceptorChain interceptorChain
           
protected  InvocationContextContainer invocationContextContainer
           
protected  boolean trace
           
 
Fields inherited from class org.jgroups.blocks.RpcDispatcher
additionalChannelListeners, method_lookup, req_marshaller, rsp_marshaller, server_obj
 
Fields inherited from class org.jgroups.blocks.MessageDispatcher
adapter, channel, concurrent_processing, corr, deadlock_detection, handler, id, local_addr, log, members, membership_listener, msg_listener, prot_adapter, req_handler, transport_adapter
 
Constructor Summary
CommandAwareRpcDispatcher()
           
CommandAwareRpcDispatcher(org.jgroups.Channel channel, org.jgroups.MessageListener l, org.jgroups.MembershipListener l2, Object serverObj, InvocationContextContainer container, InterceptorChain interceptorChain, ComponentRegistry componentRegistry, RPCManager manager)
           
 
Method Summary
protected  Object executeCommand(ReplicableCommand cmd, org.jgroups.Message req)
           
 Object handle(org.jgroups.Message req)
          Message contains a Command.
 org.jgroups.util.RspList invokeRemoteCommands(Vector<org.jgroups.Address> dests, ReplicableCommand command, int mode, long timeout, boolean anycasting, boolean oob, org.jgroups.blocks.RspFilter filter)
          Similar to RpcDispatcher.callRemoteMethods(java.util.Vector, org.jgroups.blocks.MethodCall, int, long, boolean, boolean, org.jgroups.blocks.RspFilter) except that this version is aware of ReplicableCommand objects.
protected  boolean isValid(org.jgroups.Message req)
           
 ReplicationObserver setReplicationObserver(ReplicationObserver replicationObserver)
           
 void stop()
           
 String toString()
           
 
Methods inherited from class org.jgroups.blocks.RpcDispatcher
addChannelListener, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, castMessage, channelClosed, channelConnected, channelDisconnected, channelReconnected, channelShunned, correlatorStarted, getMarshaller, getMethodLookup, getName, getRequestMarshaller, getResponseMarshaller, getServerObject, removeChannelListener, sendMessage, setMarshaller, setMethodLookup, setRequestMarshaller, setResponseMarshaller, setServerObject
 
Methods inherited from class org.jgroups.blocks.MessageDispatcher
castMessage, castMessage, castMessage, done, getChannel, getConcurrentProcessing, getDeadlockDetection, getMembers, getMessageListener, send, setChannel, setConcurrentProcessing, setDeadlockDetection, setMembershipListener, setMessageListener, setRequestHandler, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

invocationContextContainer

protected InvocationContextContainer invocationContextContainer

interceptorChain

protected InterceptorChain interceptorChain

componentRegistry

protected ComponentRegistry componentRegistry

trace

protected boolean trace
Constructor Detail

CommandAwareRpcDispatcher

public CommandAwareRpcDispatcher()

CommandAwareRpcDispatcher

public CommandAwareRpcDispatcher(org.jgroups.Channel channel,
                                 org.jgroups.MessageListener l,
                                 org.jgroups.MembershipListener l2,
                                 Object serverObj,
                                 InvocationContextContainer container,
                                 InterceptorChain interceptorChain,
                                 ComponentRegistry componentRegistry,
                                 RPCManager manager)
Method Detail

setReplicationObserver

public ReplicationObserver setReplicationObserver(ReplicationObserver replicationObserver)

stop

public void stop()
Overrides:
stop in class org.jgroups.blocks.MessageDispatcher

isValid

protected boolean isValid(org.jgroups.Message req)

invokeRemoteCommands

public org.jgroups.util.RspList invokeRemoteCommands(Vector<org.jgroups.Address> dests,
                                                     ReplicableCommand command,
                                                     int mode,
                                                     long timeout,
                                                     boolean anycasting,
                                                     boolean oob,
                                                     org.jgroups.blocks.RspFilter filter)
                                              throws NotSerializableException,
                                                     ExecutionException,
                                                     InterruptedException
Similar to RpcDispatcher.callRemoteMethods(java.util.Vector, org.jgroups.blocks.MethodCall, int, long, boolean, boolean, org.jgroups.blocks.RspFilter) except that this version is aware of ReplicableCommand objects.

Throws:
NotSerializableException
ExecutionException
InterruptedException

handle

public Object handle(org.jgroups.Message req)
Message contains a Command. Execute it against *this* object and return result.

Specified by:
handle in interface org.jgroups.blocks.RequestHandler
Overrides:
handle in class org.jgroups.blocks.RpcDispatcher

executeCommand

protected Object executeCommand(ReplicableCommand cmd,
                                org.jgroups.Message req)
                         throws Throwable
Throws:
Throwable

toString

public String toString()
Overrides:
toString in class Object


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