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

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


        queue.setActivationCallback(new QueueActivationCallback() {
          @Override
          public void activate(final MessageQueue queue) {
            try {
              queue.setActivationCallback(null);
              queue.poll(writer);

              writer.write(SSE_TERMINATION_BYTES);

              queue.heartBeat();
              writer.flush();
View Full Code Here


          }
        });

      synchronized (queue.getActivationLock()) {
        if (queue.messagesWaiting()) {
          queue.poll(writer);
          asyncContext.complete();
          return;
        }

        queue.setActivationCallback(new QueueActivationCallback() {
View Full Code Here

        queue.setActivationCallback(new QueueActivationCallback() {
          @Override
          public void activate(final MessageQueue queue) {
            try {
              queue.poll(writer);
              queue.setActivationCallback(null);

              queue.heartBeat();
              writer.flush();
            }
View Full Code Here

      if (queue != null) {
        if (shouldWait(request)) {
          doGet(request, response);
        }
        else {
          queue.poll(new OutputStreamWriteAdapter(response.getOutputStream()));
        }
      }
    }
    catch (Exception e) {
      final String message = e.getMessage();
View Full Code Here

      queue.heartBeat();

      if (sse) {
        while (!queue.isStale()) {
          prepareSSEContinue(httpServletResponse);
          queue.poll(TimeUnit.MILLISECONDS, getSSETimeout(), new OutputStreamWriteAdapter(outputStream));
          outputStream.write(SSE_TERMINATION_BYTES);
          outputStream.flush();
          queue.heartBeat();
        }
      }
View Full Code Here

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

      else if (wait) {
        queue.poll(TimeUnit.MILLISECONDS, getLongPollTimeout(), new OutputStreamWriteAdapter(outputStream));
        outputStream.close();
      }
      else {
        queue.poll(new OutputStreamWriteAdapter(outputStream));
        outputStream.close();
      }
    }
    catch (final Throwable t) {
      writeExceptionToOutputStream(httpServletResponse, t);
View Full Code Here

        }
      });

    synchronized (queue.getActivationLock()) {
      if (queue.messagesWaiting()) {
        queue.poll(writer);
        asyncContext.complete();
        return;
      }

      queue.setActivationCallback(new QueueActivationCallback() {
View Full Code Here

      queue.setActivationCallback(new QueueActivationCallback() {
        @Override
        public void activate(final MessageQueue queue) {
          try {
            queue.poll(writer);
            queue.setActivationCallback(null);

            queue.heartBeat();
            writer.flush();
          }
View Full Code Here

      if (queue != null) {
        if (shouldWait(request)) {
          doGet(request, response);
        }
        else {
          queue.poll(new OutputStreamWriteAdapter(response.getOutputStream()));
        }
      }
    }
    catch (Exception e) {
      final String message = e.getMessage();
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.