org.apache.s4.comm.udp
Class UDPListener

java.lang.Object
  extended by org.apache.s4.comm.udp.UDPListener
All Implemented Interfaces:
java.lang.Runnable, Listener

public class UDPListener
extends java.lang.Object
implements Listener, java.lang.Runnable

Implementation of a simple UDP listener.


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

Constructor Detail

UDPListener

@Inject
public UDPListener(Assignment assignment)

UDPListener

public UDPListener(Assignment assignment,
                   int UDPBufferSize)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

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