* BlockingSenderDestination
*
* @see Thread#run()
*/
public void run() {
BlockingSenderDestination blockSendDest = null;
try {
blockSendDest =
(BlockingSenderDestination) DestinationFactory
.getSenderDestination(_context.getName(), URI
.create(_uriStr));
if (blockSendDest == null) {
blockSendDest =
DestinationFactory.createBlockingSenderDestination(
_context, URI.create(_uriStr));
}
// Send message and wait for response
_response = blockSendDest.sendReceive();
if (_response != null) {
_completed = true;
// For "http"
final String alertString =
"received Message [id:"
+ _response.getMessageId()
+ "]\n"
+ "Response Code: "
+ ((HttpMessage) _response)
.getResponseCode();
alertDialog(alertString);
}
} catch (final Exception e) {
_completed = true;
alertDialog(e.toString());
} finally {
if (blockSendDest != null) {
blockSendDest.release();
}
}
}