Package java.util.concurrent.atomic

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


    }

    synchronized void removeInterestInRecordFile(int recordNumber) {
        Integer key = Integer.valueOf(recordNumber);
        AtomicInteger rr = recordReferences.get(key);
        if (rr != null && rr.decrementAndGet() <= 0) {
            recordReferences.remove(key);
        }
    }

    /**
 
View Full Code Here


                        responseHandler.response(null);
                }
                finally
                {
                    totalHintsInProgress.decrementAndGet();
                    targetHints.decrementAndGet();
                }
            }
        };

        return (Future<Void>) StageManager.getStage(Stage.MUTATION).submit(runnable);
View Full Code Here

                        final AtomicInteger latch = new AtomicInteger(channelToClose.length);
                        for (Channel channel : channelToClose) {
                            log.debug("Closing channel {}", channel.getId());
                            channel.close(immediately).addListener(new SshFutureListener() {
                                public void operationComplete(SshFuture sshFuture) {
                                    if (latch.decrementAndGet() == 0) {
                                        log.debug("Closing IoSession");
                                        ioSession.close(true).addListener(new IoSessionCloser());
                                    }
                                }
                            });
View Full Code Here

                            interruptedLatch.countDown();
                        }
                    }
                    finally
                    {
                        leaderCount.decrementAndGet();
                    }
                }

                @Override
                public void stateChanged(CuratorFramework client, ConnectionState newState)
View Full Code Here

        }

        // Decrement camel job count for this endpoint
        AtomicInteger number = (AtomicInteger) scheduler.getContext().get(QuartzConstants.QUARTZ_CAMEL_JOBS_COUNT);
        if (number != null) {
            number.decrementAndGet();
        }
    }

    private void addJobInScheduler() throws Exception {
        // Add or use existing trigger to/from scheduler
View Full Code Here

    }

    private static void decrementJobCounter(Scheduler scheduler) throws SchedulerException {
        AtomicInteger number = (AtomicInteger) scheduler.getContext().get("CamelJobs");
        if (number != null) {
            number.decrementAndGet();
        }
    }

    private static void incrementJobCounter(Scheduler scheduler) throws SchedulerException {
        AtomicInteger number = (AtomicInteger) scheduler.getContext().get("CamelJobs");
View Full Code Here

    // When the latch reaches zero, send receipt (if it was requested).
    final AtomicInteger callbackCount = new AtomicInteger(1);
    final Runnable countDown = new Runnable() {
      @Override
      public void run() {
        if (callbackCount.decrementAndGet() == 0 && receiptRequested != null) {
          Message response = XmppUtil.createResponseMessage(updateMessage);
          response.addChildElement("received", XmppNamespace.NAMESPACE_XMPP_RECEIPTS);
          responseCallback.run(response);
        }
      }
View Full Code Here

    // Fetch any signer info that we don't already have and then run internalUpdate
    final AtomicInteger numSignerInfoPrefetched = new AtomicInteger(1); // extra 1 for sentinel
    final Runnable countDown = new Runnable() {
      @Override
      public void run() {
        if (numSignerInfoPrefetched.decrementAndGet() == 0) {
          internalUpdateAfterSignerInfoRetrieval(
              appliedDeltas, domain, federationProvider, certificateManager, futureResult);
        }
      }
    };
View Full Code Here

          } catch (IOException e) {
            // exceptions here are bad, don't ignore them
            throw new RuntimeException(e);
          } finally {
            // count-down number of failures
            failures.decrementAndGet();
            assert failures.get() >= 0 : "handler failed too many times: " + failures.get();
            if (VERBOSE) {
              if (failures.get() == 0) {
                System.out.println("no more failures expected");
              } else {
View Full Code Here

            _TestUtil.checkIndex(handlerTaxoDir.getDelegate());
          } catch (IOException e) {
            throw new RuntimeException(e);
          } finally {
            // count-down number of failures
            failures.decrementAndGet();
            assert failures.get() >= 0 : "handler failed too many times: " + failures.get();
            if (VERBOSE) {
              if (failures.get() == 0) {
                System.out.println("no more failures expected");
              } else {
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.