Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicInteger.incrementAndGet()


                failures.incrementAndGet();
                fail();
              }
            } catch (IOException e) {
              e.printStackTrace();
              failures.incrementAndGet();
              fail();
            }
          }
        }
      };
View Full Code Here


              List<Cell> r = new ArrayList<Cell>();
              while(rs.next(r));
              rs.close();
              if (r.size() != 1) {
                LOG.debug(r);
                failures.incrementAndGet();
                fail();
              }
            } catch (IOException e) {
              e.printStackTrace();
              failures.incrementAndGet();
View Full Code Here

                failures.incrementAndGet();
                fail();
              }
            } catch (IOException e) {
              e.printStackTrace();
              failures.incrementAndGet();
              fail();
            }
          }
        }
      };
View Full Code Here

        if (current == null) {
            current = new AtomicInteger(0);
            ((HttpServletRequest)request).setAttribute(header, current);
        }

        ((HttpServletResponse) response).setHeader(header, String.valueOf(current.incrementAndGet()));
        chain.doFilter(request, response);
    }

    public void destroy() {
    }
View Full Code Here

    ResourceDeclaration invocation = mockChannel.channelHandler.consumerDeclarations.get("test-tag");
    final ConsumerDelegate consumerDelegate = (ConsumerDelegate) invocation.args[invocation.args.length - 1];
    new Thread() {
      public void run() {
        try {
          for (; deliveryTag.get() <= 100000 && consume.get(); deliveryTag.incrementAndGet()) {
            consumerDelegate.handleDelivery("test-tag", new Envelope(deliveryTag.get(), false, "x",
                "#"), null, ("foo-" + deliveryTag).getBytes());
            Thread.sleep(5);
          }
        } catch (Exception e) {
View Full Code Here

                    return new Rectangle(5, 6);
                }

                if ( resource.name().equals("classResource") )
                {
                    classResourceCount.incrementAndGet();
                    return 7.8;
                }

                return null;
            }
View Full Code Here

        final ResourceLocator resourceLocator2 = new ResourceLocator()
        {
            @Override
            public Object locate(Resource resource, ResourceLocator nextInChain) throws Exception
            {
                resourceLocator2Count.incrementAndGet();
                return nextInChain.locate(resource, nextInChain);
            }
        };
        Injector injector = lifecycleInjectorBuilder.withBootstrapModule
            (
View Full Code Here

    AtomicInteger counter = logFileIDReferenceCounts.get(fileID);
    if(counter == null) {
      counter = new AtomicInteger(0);
      logFileIDReferenceCounts.put(fileID, counter);
    }
    counter.incrementAndGet();
  }
  @Override
  protected void decrementFileID(int fileID) {
    AtomicInteger counter = logFileIDReferenceCounts.get(fileID);
    Preconditions.checkState(counter != null, "null counter ");
View Full Code Here

                    // repeatedly try to process documents while some still
                    // remain
                    while (docIter.hasNext()) {
                        long startTime = System.currentTimeMillis();
                        Document doc = docIter.next();
                        int docNumber = count.incrementAndGet();
                        int terms = 0;
                        try {
                            sspace.processDocument(doc.reader());
                        } catch (Throwable t) {
                            t.printStackTrace();
View Full Code Here

                    // minimum double value.
                    if (association == null) {
                        unanswered.incrementAndGet();
                        compScores[index] = Double.MIN_VALUE;
                    } else {
                        answered.incrementAndGet();

                        // Scale the associated result to within the test's
                        // range of values
                        compScores[index] =
                            (association * testRange) + getLowestScore();
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.