if (sender != null) {
senderUri = getSenderUrl(sender.getId(), receiverUrl);
}
receive(receiverId, message, senderUri, tag);
} else {
TransportService service = null;
URI senderUri = null;
if (sender != null) {
senderUri = getSenderUrl(sender.getId(), receiverUrl);
}
service = getTransportService(protocol);
if (service != null) {
// TODO: message should already be a String?
service.sendAsync(senderUri, receiverUrl, message.toString(),
tag);
} else {
throw new ProtocolException(
"No transport service configured for protocol '"
+ protocol + "'.");