public void sendMessage(final FleaseMessage message, final InetSocketAddress recipient) {
assert (recipient != null && message != null);
try {
ConditionClient c = states.getByAddress(recipient);
assert (c != null) : "could not retrieve client for " + recipient.toString();
message.setSender(sender);
Logging.logMessage(Logging.LEVEL_DEBUG, this, "Sending '%s' from '%s' to '%s' ... ",
message.toString(), sender.toString(), recipient.toString());
c.flease(message).registerListener(new ClientResponseAvailableListener<Object>() {
@Override
public void requestFailed(Exception e) {
// Flease does not care about failures on sending messages!
Logging.logMessage(Logging.LEVEL_INFO, this,