use of won.protocol.message.sender.WonMessageSender in project webofneeds by researchstudio-sat.
the class DelayedDuplicateMessageSenderDecorator method getWonMessageSender.
@Override
public WonMessageSender getWonMessageSender() {
final WonMessageSender delegate = super.getWonMessageSender();
return new WonMessageSender() {
@Override
public void sendWonMessage(WonMessage message) throws WonMessageSenderException {
delegate.sendWonMessage(message);
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
logger.warn("caught while waiting the delay time before sending duplicate message", e);
}
delegate.sendWonMessage(message);
}
};
}
use of won.protocol.message.sender.WonMessageSender in project webofneeds by researchstudio-sat.
the class DuplicateMessageSenderDecorator method getWonMessageSender.
@Override
public WonMessageSender getWonMessageSender() {
final WonMessageSender delegate = super.getWonMessageSender();
return new WonMessageSender() {
@Override
public void sendWonMessage(WonMessage message) throws WonMessageSenderException {
delegate.sendWonMessage(message);
delegate.sendWonMessage(message);
}
};
}
Aggregations