Data
- The type of data this pipeline sends and receives. Must be serializable.Addr
- The type of the address that the underlying communication protocol uses.public abstract class DataPipe<Data extends java.io.Serializable,Addr>
extends java.lang.Object
Constructor and Description |
---|
DataPipe() |
Modifier and Type | Method and Description |
---|---|
void |
addDataReceivedListener(DataReceivedListener<Data,Addr> listener)
Adds a data receiver listener to the receiver daemon.
|
abstract void |
close()
Close all non-serializable entities of this data pipe (e.g., opened sockets, daemon threads, etc..)
|
abstract void |
initReceiver()
Initialize the receiver daemon
|
void |
sendData(Data data,
Addr ip_address)
Interface for non-threaded sending of singleton data
|
void |
sendData(Data data,
Addr ip_address,
boolean threaded)
Interface for sending of singleton data.
|
abstract void |
sendData(java.util.List<Data> data_list,
Addr address)
Send the given list of data to the given address
|
void |
sendData(java.util.List<Data> data_list,
Addr ip_address,
boolean threaded)
A general send data interface.
|
void |
sendDataThreaded(Data data,
Addr ip_address)
Interface for threaded sending of singleton data
|
void |
sendDataThreaded(java.util.List<Data> data_list,
Addr ip_address)
Creates a thread that sends the given data
|
void |
setConnectExceptionListener(ExceptionListener listener)
Sets an exception listener for connecting operations.
|
void |
setExceptionListener(ExceptionListener listener)
Sets an exception listener to the receiver daemon.
|
void |
setReceiveExceptionListener(ExceptionListener listener)
Sets an exception listener to the receiver daemon.
|
void |
setReceiverDaemon(ReceiverDaemon<Data,Addr> receiver)
Set receiver as the receiver daemon of this data pipe.
|
void |
setSendExceptionListener(ExceptionListener listener)
Sets an exception listener for sending operations.
|
public void setReceiverDaemon(ReceiverDaemon<Data,Addr> receiver)
receiver
- a receiver daemon, that handles incoming data.public abstract void initReceiver()
public abstract void close()
public abstract void sendData(java.util.List<Data> data_list, Addr address)
data_list
- list of data to send.address
- the recipient of the data.public void addDataReceivedListener(DataReceivedListener<Data,Addr> listener)
listener
- the listener to add.public void setExceptionListener(ExceptionListener listener)
listener
- the listener to use.public void setReceiveExceptionListener(ExceptionListener listener)
listener
- the listener to use.public void setSendExceptionListener(ExceptionListener listener)
listener
- the listener to use.public void setConnectExceptionListener(ExceptionListener listener)
listener
- the listener to use.public void sendDataThreaded(java.util.List<Data> data_list, Addr ip_address)
data_list
- list of data to send.address
- the recipient of the data.public void sendData(java.util.List<Data> data_list, Addr ip_address, boolean threaded)
data_list
- list of data to send.address
- the recipient of the data.threaded
- true if data is to be sent by a dedicated thread.public void sendData(Data data, Addr ip_address)
data
- the data to send.ip_address
- the recipient of the data.public void sendDataThreaded(Data data, Addr ip_address)
data
- the data to send.ip_address
- the recipient of the data.public void sendData(Data data, Addr ip_address, boolean threaded)
data
- the data to send.ip_address
- the recipient of the data.threaded
- true if data is to be sent by a dedicated thread.