public abstract class AbstractTcpReader
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
AbstractTcpReader(int port,
int bufferCapacity,
Log logger)
Constructs a new TCP reader.
|
Modifier and Type | Method and Description |
---|---|
int |
getPort() |
protected abstract boolean |
onBufferReceived(java.nio.ByteBuffer buffer) |
void |
run() |
void |
terminate()
Gracefully terminates this TCP reader.
|
protected final Log logger
public AbstractTcpReader(int port, int bufferCapacity, Log logger)
port
- on which to listen for requestsbufferCapacity
- of the used read bufferlogger
- for notification to users and developerspublic final void run()
run
in interface java.lang.Runnable
protected abstract boolean onBufferReceived(java.nio.ByteBuffer buffer)
buffer
- to be read fromtrue
when there were enough bytes to perform the read operation
false
otherwise. In this case, the buffer is reset, compacted, and filled with new content.public void terminate()
public int getPort()
Copyright 2017 Kieker Project, http://kieker-monitoring.net