Package org.jboss.errai.bus.server.api

Examples of org.jboss.errai.bus.server.api.MessageQueue.poll()


            return;
          }
        }
      }
      else if (wait) {
        queue.poll(TimeUnit.MILLISECONDS, getLongPollTimeout(), new OutputStreamWriteAdapter(outputStream));
      }
      else {
        queue.poll(new OutputStreamWriteAdapter(outputStream));
      }
    }
View Full Code Here


      }
      else if (wait) {
        queue.poll(TimeUnit.MILLISECONDS, getLongPollTimeout(), new OutputStreamWriteAdapter(outputStream));
      }
      else {
        queue.poll(new OutputStreamWriteAdapter(outputStream));
      }
    }
    catch (final IOException io) {
      log.debug("Problem when polling for new messages", io);
    }
View Full Code Here

      });

    synchronized (queue.getActivationLock()) {
      if (queue.messagesWaiting()) {
        try {
          queue.poll(new OutputStreamWriteAdapter(asyncContext.getResponse().getOutputStream()));
          asyncContext.complete();
        }
        catch(IOException ioe) {
          log.debug("Problem when polling for new messages", ioe);      
        }
View Full Code Here

      queue.setActivationCallback(new QueueActivationCallback() {
        @Override
        public void activate(final MessageQueue queue) {
          try {
            queue.poll(new OutputStreamWriteAdapter(asyncContext.getResponse().getOutputStream()));
            queue.setActivationCallback(null);
            queue.heartBeat();
          }
          catch (IOException e) {
            log.debug("Closing queue with id: " + queue.getSession().getSessionId() + " due to IOException", e);
View Full Code Here

      if (queue != null) {
        if (shouldWait(request)) {
          doGet(request, response);
        }
        else {
          queue.poll(new OutputStreamWriteAdapter(response.getOutputStream()));
        }
      }
    }
    catch (final IOException ioe) {
      log.debug("Problem when storing message", ioe);
View Full Code Here

        return;
      }

      queue.heartBeat();

      queue.poll(wait, outputStream);

      outputStream.close();
    }
    catch (final Throwable t) {
      t.printStackTrace();
View Full Code Here

        return;
      }

      queue.heartBeat();

      queue.poll(wait, outputStream);

      outputStream.close();
    }
    catch (final Throwable t) {
      t.printStackTrace();
View Full Code Here

      });

    synchronized (queue.getActivationLock()) {
      if (queue.messagesWaiting()) {
        try {
          queue.poll(new OutputStreamWriteAdapter(asyncContext.getResponse().getOutputStream()));
          asyncContext.complete();
        }
        catch(IOException ioe) {
          log.debug("Problem when polling for new messages", ioe);      
        }
View Full Code Here

      queue.setActivationCallback(new QueueActivationCallback() {
        @Override
        public void activate(final MessageQueue queue) {
          try {
            queue.poll(new OutputStreamWriteAdapter(asyncContext.getResponse().getOutputStream()));
            queue.setActivationCallback(null);
            queue.heartBeat();
          }
          catch (IOException e) {
            log.debug("Closing queue with id: " + queue.getSession().getSessionId() + " due to IOException", e);
View Full Code Here

      if (queue != null) {
        if (shouldWait(request)) {
          doGet(request, response);
        }
        else {
          queue.poll(new OutputStreamWriteAdapter(response.getOutputStream()));
        }
      }
    }
    catch (final IOException ioe) {
      log.debug("Problem when storing message", ioe);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.