Package net.rim.device.api.io.messaging

Examples of net.rim.device.api.io.messaging.BlockingSenderDestination


    _processor = new XMLHashtableMessageProcessor(false, false);
  }

  public boolean search(String query, int index, int max, ResponseListener listener) {
    try {
      BlockingSenderDestination destination = DestinationFactory.createBlockingSenderDestination(_context,
          URI.create(buildQueryURL(query, index, max)), _processor);
      new MessageThread(destination, listener).start();
      return true;
    } catch (Throwable t) {
      YoutubeClient.log(t.toString());
View Full Code Here


         * 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();
                }
            }
        }
View Full Code Here

TOP

Related Classes of net.rim.device.api.io.messaging.BlockingSenderDestination

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.