public class BlaubotMessageSender
extends java.lang.Object
Constructor and Description |
---|
BlaubotMessageSender(IBlaubotConnection blaubotConnection) |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates the message receiver (reading from the connection)
|
void |
deactivate(IActionListener actionListener)
Deactivates the message sender (completes current message readings, if any and then shuts down).
|
boolean |
equals(java.lang.Object o) |
protected IBlaubotConnection |
getBlaubotConnection()
The connection that is managed by this message sender.
|
protected long |
getQueuedBytes()
The current number of bytes in this MessageSender's queue.
|
protected int |
getQueueSize()
The current amount of messages in the queue
|
long |
getSentMessages()
sent messages
|
long |
getSentPayloadBytes() |
int |
hashCode() |
void |
sendMessage(BlaubotMessage message)
Queues the given message to be sent over the IBlaubotConnection this object was
created with.
|
java.lang.String |
toString() |
public BlaubotMessageSender(IBlaubotConnection blaubotConnection)
public void sendMessage(BlaubotMessage message)
message
- the message to be sendpublic void activate()
public void deactivate(IActionListener actionListener)
actionListener
- callback to be informed when the sender was closed (thread finished), can be nullpublic long getSentPayloadBytes()
public long getSentMessages()
protected IBlaubotConnection getBlaubotConnection()
protected int getQueueSize()
protected long getQueuedBytes()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object