Package org.hobbit.core.rabbit
Interface DataReceiver
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DataReceiverImpl
public interface DataReceiver extends Closeable
An interface for a class that receives data and offers methods to close the receiving when it is finished and to check the receiver for errors that might have been encountered.- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcloseWhenFinished()This method waits for theDataReceiverto finish its work and closes the incoming queue as well as the internal thread pool after that.DataHandlergetDataHandler()intgetErrorCount()Returns the number of errors that have been encountered while receiving data.RabbitQueuegetQueue()voidincreaseErrorCount()
-
-
-
Method Detail
-
getErrorCount
int getErrorCount()
Returns the number of errors that have been encountered while receiving data. If this number is not 0 the receiver can not guarantee that all data has been received correctly.- Returns:
- the number of errors encountered during the receiving of data
-
closeWhenFinished
void closeWhenFinished()
This method waits for theDataReceiverto finish its work and closes the incoming queue as well as the internal thread pool after that. For making sure that all data is received this method should be preferred compared to theCloseable.close()method which might close the receiver in a rude way.
-
increaseErrorCount
void increaseErrorCount()
-
getDataHandler
DataHandler getDataHandler()
-
getQueue
RabbitQueue getQueue()
-
-