Examples of TickCache


Examples of org.jboss.errai.cdi.demo.stock.client.shared.TickCache

    List<TickCache> histories = new ArrayList<TickCache>();

    // FIXME thread safety problem here. should synchronize on the tick caches here and in the ticker.
    for (Map.Entry<String, TickCache> tickEntry : tickCaches.entrySet()) {
      TickCache tickCache = tickEntry.getValue();
      histories.add(tickCache);
    }

    SubscriptionReply reply = new SubscriptionReply();
    reply.setTickHistories(histories);
View Full Code Here

Examples of org.jboss.errai.cdi.demo.stock.client.shared.TickCache

  public void startTicker() {

    // bootstrap the list of symbols
    String[] symbols = new String[] { "ABC", "DEF", "GHI", "JKL", "MNO", "PQR", "STU.V", "WXY.Z" };
    for (String symbol : symbols) {
      TickCache tickCache = new TickCache(new LinkedBlockingQueue<Tick>());
      tickCache.add(generateBootstrapTick(symbol));
      tickCaches.put(symbol, tickCache);
    }

    tickGenerator.scheduleAtFixedRate(new Runnable() {
      @Override
View Full Code Here

Examples of org.jboss.errai.cdi.demo.stock.client.shared.TickCache

  private void generateTicks() {
    for (Map.Entry<String, TickCache> tickEntry : tickCaches.entrySet()) {
      if (random.nextInt(1000) > 200) {
        continue;
      }
      TickCache tickCache = tickEntry.getValue();
      Tick newTick = generateTick(tickCache.getNewestEntry());
      tickCache.add(newTick);
      tickEvent.fire(newTick);
    }
  }
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.