[infinispan-dev] [jboss-cluster-dev] MyRpcDispatcher

Bela Ban bban at redhat.com
Tue Apr 13 00:57:10 EDT 2010



Paul Ferraro wrote:
> Galder,
>
> To which method is Bela referring?

Actually, it was you, and the method was Channel.getUpHandler(). This is 
done.

> Otherwise, I'm ready to check in the org.jgroups.blocks.mux package.
> There is a small change required in MessageDispatcher.setChannel(...):
>
> channel.setUpHandler(prot_adapter);
>
> needs to be replaced by:
>
> if (channel.getUpHandler() == null)
> channel.setUpHandler(prot_adapter);
>
> This is need to prevent each new RpcDispatcher/MessageDispatcher from
> overwriting the preexisting multiplexing UpHandler.
> I can't envision this breaking any existing use case, but I wanted to
> verify before committing.
>
> So, to review, usage will now look like:
>
> Channel c = new JChannel(...);
>
> // RpcDispatcher d = new RpcDispatcher(c, null, null, target);
> // c.setUpHandler(new MuxUpHandler(d.getProtocolAdapter());
>
> c.setUpHandler(new MuxUpHandler());
>
> RpcDispatcher d1 = new MuxRpcDispatcher((short) 1, c, null, null, target);
> RpcDispatcher d1 = new MuxRpcDispatcher((short) 2, c, null, null, target);

Does a MuxRpcDispatcher grab the MuxUpHandler of a channel and register 
itself with it ?

> c.connect(...);

-- 
Bela Ban
Lead JGroups / Clustering Team
JBoss



More information about the infinispan-dev mailing list