org.apache.s4.comm.tcp
Class TCPListener

java.lang.Object
  extended by org.apache.s4.comm.tcp.TCPListener
All Implemented Interfaces:
Listener

public class TCPListener
extends java.lang.Object
implements Listener

Receives messages through TCP for the assigned subcluster.


Nested Class Summary
 class TCPListener.ChannelHandler
           
 
Constructor Summary
TCPListener(Assignment assignment, int timeout)
           
 
Method Summary
 void close()
           
 int getPartitionId()
           
 byte[] recv()
          Perform blocking receive on the appropriate communication channel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPListener

@Inject
public TCPListener(Assignment assignment,
                          int timeout)
Method Detail

recv

public byte[] recv()
Description copied from interface: Listener
Perform blocking receive on the appropriate communication channel

Specified by:
recv in interface Listener
Returns:
  • byte[] message returned by the channel
  • null if the associated blocking thread is interrupted

getPartitionId

public int getPartitionId()
Specified by:
getPartitionId in interface Listener

close

public void close()
Specified by:
close in interface Listener