org.apache.s4.comm.tcp
Class TCPEmitter

java.lang.Object
  extended by org.apache.s4.comm.tcp.TCPEmitter
All Implemented Interfaces:
Emitter, ClusterChangeListener
Direct Known Subclasses:
TCPRemoteEmitter

public class TCPEmitter
extends java.lang.Object
implements Emitter, ClusterChangeListener

TCPEmitter - Uses TCP to send messages across partitions.


Constructor Summary
TCPEmitter(Cluster topology, int timeout)
           
 
Method Summary
 void close()
           
 int getPartitionCount()
           
 void onChange()
           
protected  void removeChannel(int partition)
           
 boolean send(int partitionId, EventMessage message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPEmitter

@Inject
public TCPEmitter(Cluster topology,
                         int timeout)
           throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException
Method Detail

send

public boolean send(int partitionId,
                    EventMessage message)
Specified by:
send in interface Emitter
Parameters:
partitionId - - destination partition
message - - message payload that needs to be sent
Returns:
- true - if message is sent across successfully - false - if send fails

removeChannel

protected void removeChannel(int partition)

close

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

onChange

public void onChange()
Specified by:
onChange in interface ClusterChangeListener

getPartitionCount

public int getPartitionCount()
Specified by:
getPartitionCount in interface Emitter