[infinispan-dev] MyRpcDispatcher

Bela Ban bban at redhat.com
Mon Apr 12 07:22:06 EDT 2010


Done, I added getUpHandler() to Channel

Paul Ferraro wrote:
>
> The other problem is that Channel does not expose a public mechanism to
> see the current UpHandler, i.e. while Channel.up_handler is protected,
> there is no public Channel.getUpHandler().
> If this existed, we could replace the channel.setUpHandler(...) w/a
> protected method like:
>
> protected void setUpHandler(UpHandler handler) {
> channel.setUpHandler(handler);
> }
>
> where ScopedRpcDispatcher can overload it using:
>
> protected void setUpHandler(UpHandler handler) {
> UpHandler currentHandler = channel.getUpHandler(); // NoSuchMethod
> if ((currentHandler != null) && (currentHandler instanceof 
> ScopedUpHandler)) {
> ((ScopedUpHandler) currentHandler).add(this.scope, handler);
> } else {
> channel.setUpHandler(handler);
> }
> }
>
> We also wouldn't yet have a reference to the scope at the time this
> method is normally called (i.e. from MessageDispatcher's constructor) -
> though we could work around this by passing a null channel to the super
> constructor, and calling setChannel(...) at the end of our constructor.

-- 
Bela Ban
Lead JGroups / Clustering Team
JBoss



More information about the infinispan-dev mailing list