Examples of MessageQueue


Examples of aleph.thread.MessageQueue

   * Constructor for incoming connection.
   * @param socket use this socket
   **/
  public AutoConnection () {
    super();
    queue = new MessageQueue();
  }
View Full Code Here

Examples of com.alibaba.rocketmq.common.message.MessageQueue

            SendMessageResponseHeader responseHeader =
                    (SendMessageResponseHeader) response
                        .decodeCommandCustomHeader(SendMessageResponseHeader.class);

            MessageQueue messageQueue =
                    new MessageQueue(msg.getTopic(), brokerName, responseHeader.getQueueId());

            return new SendResult(sendStatus, responseHeader.getMsgId(), messageQueue,
                responseHeader.getQueueOffset(), projectGroupPrefix);
        }
        default:
View Full Code Here

Examples of com.dianping.cat.message.spi.MessageQueue

    Map<String, MessageAnalyzer> analyzers = new LinkedHashMap<String, MessageAnalyzer>();

    m_tasks = new ArrayList<PeriodTask>(names.size());
    for (String name : names) {
      MessageAnalyzer analyzer = m_analyzerManager.getAnalyzer(name, startTime);
      MessageQueue queue = new DefaultMessageQueue(QUEUE_SIZE);
      PeriodTask task = new PeriodTask(m_serverStateManager, analyzer, queue, startTime);

      analyzers.put(name, analyzer);
      task.enableLogging(m_logger);
      m_tasks.add(task);
View Full Code Here

Examples of com.google.caja.reporting.MessageQueue

      return;
    }

    boolean passed = false;

    MessageQueue mq = new SimpleMessageQueue();
    MessageContext mc = new MessageContext();
    Uri contextUri = req.getUri();
    InputSource is = new InputSource(contextUri.toJavaUri());

    PluginMeta pluginMeta = new PluginMeta(
View Full Code Here

Examples of com.google.caja.reporting.MessageQueue

  public CajoledResult rewrite(Uri uri, String container, String mime,
      boolean es53, boolean debug) {
    URI javaUri = uri.toJavaUri();
    InputSource is = new InputSource(javaUri);
    MessageQueue mq = new SimpleMessageQueue();
    try {
      UriFetcher fetcher = makeFetcher(uri, container);
      ExternalReference extRef = new ExternalReference(javaUri,
          FilePosition.instance(is, /*lineNo*/ 1, /*charInFile*/ 1, /*charInLine*/ 1));
      // If the fetch fails, a UriFetchException is thrown and serialized as part of the
      // message queue.
      CharProducer cp = fetcher.fetch(extRef, mime).getTextualContent();
      ParseTreeNode ptn = parse(is, cp, mime, mq);
      return rewrite(uri, container, ptn, es53, debug);
    } catch (UnsupportedEncodingException e) {
      LOG.severe("Unexpected inability to recognize mime type: " + mime);
      mq.addMessage(ServiceMessageType.UNEXPECTED_INPUT_MIME_TYPE,
          MessagePart.Factory.valueOf(mime));
    } catch (UriFetchException e) {
      LOG.info("Failed to retrieve: " + e.toString());
    } catch (ParseException e) {
      mq.addMessage(MessageType.PARSE_ERROR, FilePosition.UNKNOWN);
    }
    return new CajoledResult(null, null, mq.getMessages(), /* hasErrors */ true);
  }
View Full Code Here

Examples of com.google.caja.reporting.MessageQueue

  public CajoledResult rewrite(Uri gadgetUri, String container,
      ParseTreeNode root, boolean es53, boolean debug) {
    UriFetcher fetcher = makeFetcher(gadgetUri, container);
    UriPolicy policy = makePolicy(gadgetUri);
    URI javaGadgetUri = gadgetUri.toJavaUri();
    MessageQueue mq = new SimpleMessageQueue();
    MessageContext context = new MessageContext();
    PluginMeta meta = new PluginMeta(fetcher, policy);
    PluginCompiler compiler = makePluginCompiler(meta, mq);
    compiler.setMessageContext(context);
    if (moduleCache != null) {
View Full Code Here

Examples of com.google.caja.reporting.MessageQueue

        public URI rewrite(ExternalReference externalReference, String string) {
          return retrievedUri.resolve(externalReference.getUri());
        }
      };

      MessageQueue mq = new SimpleMessageQueue();
      BuildInfo bi = BuildInfo.getInstance();
      DefaultGadgetRewriter rw = new DefaultGadgetRewriter(bi, mq);
      rw.setValijaMode(true);
      InputSource is = new InputSource(retrievedUri);
      String origContent = content.getContent();
View Full Code Here

Examples of com.google.caja.reporting.MessageQueue

        });
    if (queue.isEmpty()) {
      // Return empty stylesheet
      return new CssTree.StyleSheet(null, Collections.<CssTree.CssStatement>emptyList());
    }
    MessageQueue mq = new SimpleMessageQueue();
    CssParser parser = new CssParser(queue, mq, MessageLevel.WARNING);
    return parser.parseStyleSheet();
  }
View Full Code Here

Examples of com.jbidwatcher.util.queue.MessageQueue

  }

  private void spinOffCompletedLoader(final AuctionServer newServer) {
    Thread completedHandler = new Thread() {
      public void run() {
        final MessageQueue tabQ = MQFactory.getConcrete("complete Tab");
        tabQ.enqueue("REPORT Importing completed listings");
        tabQ.enqueue("SHOW");

        timeStart("findEnded");
        List<AuctionEntry> entries = AuctionEntry.findEnded();//TODO EntryCorral these?
        timeStop("findEnded");

        int endedCount = entries.size();
        final double percentStep = ((double)endedCount) / 100.0;
        final double percentMultiple = 100.0 / ((double)endedCount);
        tabQ.enqueue("PROGRESS");
        tabQ.enqueue("PROGRESS Loading...");
        importListingsToUI(newServer, entries, new Report() {
          public void report(AuctionEntry ae, int count) {
            if(percentStep < 1.0) {
              tabQ.enqueue("PROGRESS " + Math.round(count * percentMultiple));
            } else {
              if(count % (Math.round(percentStep)) == 0) {
                tabQ.enqueue("PROGRESS " + Math.round(count / percentStep));
              }
            }
            try { Thread.sleep(50); } catch(InterruptedException ie) { /* ignore */ }
          }
        });
        tabQ.enqueue("HIDE");
        AuctionEntry.getRealDatabase().commit();
      }
    };
    Thread lostHandler = new Thread() {
      public void run() {
View Full Code Here

Examples of com.netflix.astyanax.recipes.queue.MessageQueue

        final long max_count = 1000000;

        final CountingQueueStats stats = new CountingQueueStats();

        final ConsistencyLevel cl = ConsistencyLevel.CL_ONE;
        final MessageQueue scheduler = new ShardedDistributedMessageQueue.Builder()
                .withColumnFamily(SCHEDULER_NAME_CF_NAME)
                .withQueueName("StressQueue"+qNameSfx)
                .withKeyspace(keyspace)
                .withConsistencyLevel(cl)
                .withStats(stats)
                .withTimeBuckets(10, 30, TimeUnit.SECONDS)
                .withShardCount(100)
                .withPollInterval(100L, TimeUnit.MILLISECONDS)
                .withShardLockManager(slm)
                .build();

        scheduler.createStorage();
        Thread.sleep(1000);
        scheduler.createQueue();

        final ConcurrentMap<String, Boolean> lookup = Maps.newConcurrentMap();

        final int batchSize = 50;

        Executors.newSingleThreadExecutor().execute(new Runnable() {
            @Override
            public void run() {
                MessageProducer producer = scheduler.createProducer();
                for (int i = 0; i < max_count / batchSize; i++) {
                    long tm = System.currentTimeMillis();
                    List<Message> messages = Lists.newArrayList();
                    for (int j = 0; j < batchSize; j++) {
                        long id = insertCount.incrementAndGet();
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.