net.tomp2p.rpc
Class RequestHandlerTCP

java.lang.Object
  extended by net.tomp2p.rpc.RequestHandlerTCP
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public class RequestHandlerTCP
extends Object
implements org.jboss.netty.channel.ChannelUpstreamHandler

Is able to send messages (as a request) and processes incoming replies.

Author:
Thomas Bocek

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
RequestHandlerTCP(FutureResponse futureResponse, PeerBean peerBean, ConnectionBean connectionBean, Message message)
           
 
Method Summary
 FutureResponse fireAndForgetTCP(ChannelCreator channelCreator)
           
 FutureResponse getFutureResponse()
           
protected  PeerMap getPeerMap()
           
 void handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelEvent ce)
           
 FutureResponse sendTCP(ChannelCreator channelCreator)
           
 FutureResponse sendTCP(ChannelCreator channelCreator, int idleTCPMillis)
           
 void setKeepAlive(boolean isKeepAlive)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestHandlerTCP

public RequestHandlerTCP(FutureResponse futureResponse,
                         PeerBean peerBean,
                         ConnectionBean connectionBean,
                         Message message)
Parameters:
objectHolder - the bean representing the node this handler belongs to
Method Detail

getFutureResponse

public FutureResponse getFutureResponse()

sendTCP

public FutureResponse sendTCP(ChannelCreator channelCreator)

sendTCP

public FutureResponse sendTCP(ChannelCreator channelCreator,
                              int idleTCPMillis)

fireAndForgetTCP

public FutureResponse fireAndForgetTCP(ChannelCreator channelCreator)

getPeerMap

protected PeerMap getPeerMap()

setKeepAlive

public void setKeepAlive(boolean isKeepAlive)

handleUpstream

public void handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
                           org.jboss.netty.channel.ChannelEvent ce)
                    throws Exception
Specified by:
handleUpstream in interface org.jboss.netty.channel.ChannelUpstreamHandler
Throws:
Exception


Copyright © 2011. All Rights Reserved.