Package java.util.concurrent

Examples of java.util.concurrent.Semaphore.release()


            }

            if ( !itemNode.startsWith(QUEUE_ITEM_NAME) )
            {
                log.warn("Foreign node in queue path: " + itemNode);
                processedLatch.release();
                continue;
            }

            if ( min-- <= 0 )
            {
View Full Code Here


            if ( min-- <= 0 )
            {
                if ( refreshOnWatch && (currentVersion != childrenCache.getData().version) )
                {
                    processedLatch.release(children.size());
                    break;
                }
            }

            if ( getDelay(itemNode) > 0 )
View Full Code Here

                }
            }

            if ( getDelay(itemNode) > 0 )
            {
                processedLatch.release();
                continue;
            }

            executor.execute
            (
View Full Code Here

                        {
                            log.error("Error processing message at " + itemNode, e);
                        }
                        finally
                        {
                            processedLatch.release();
                        }
                    }
                }
            );
        }
View Full Code Here

   
    final Semaphore result = new Semaphore(0);
   
    QuiesceCallback qc = new QuiesceCallback() {
      public void bundleQuiesced(Bundle... bundlesQuiesced) {
        result.release();
      }
    };
   
    bqp.quiesce(qc, Arrays.asList(testBundle));
   
View Full Code Here

                for (int i = 0; running.get(); i++) {
                    try {
                        NodeBuilder a = store.getRoot().builder();
                        a.setProperty("foo", "abc" + i);
                        store.merge(a, EmptyHook.INSTANCE, null);
                        semaphore.release();
                    } catch (CommitFailedException e) {
                        fail();
                    }
                }
            }
View Full Code Here

        DocumentStore testStore = new TimingDocumentStoreWrapper(docStore) {
            @Override
            public void invalidateCache() {
                super.invalidateCache();
                semaphore.acquireUninterruptibly();
                semaphore.release();
            }
        };
        final MongoNodeStore store1 = new MongoMK.Builder().setAsyncDelay(0)
                .setDocumentStore(testStore).setClusterId(1).getNodeStore();
        MongoNodeStore store2 = new MongoMK.Builder().setAsyncDelay(0)
View Full Code Here

        // must still not be visible at this state
        try {
            assertFalse(root.hasChildNode("node2"));
        } finally {
            semaphore.release();
        }
        t.join();
        // background operations completed
        root = store1.getRoot();
        // now node2 is visible
View Full Code Here

                @Override
                public void stateChanged(CuratorFramework client, ConnectionState newState)
                {
                    if ( (newState == ConnectionState.LOST) || (newState == ConnectionState.SUSPENDED) )
                    {
                        semaphore.release();
                    }
                    else if ( newState == ConnectionState.RECONNECTED )
                    {
                        latch.countDown();
                    }
View Full Code Here

                @Override
                public void stateChanged(CuratorFramework client, ConnectionState newState)
                {
                    if ( (newState == ConnectionState.LOST) || (newState == ConnectionState.SUSPENDED) )
                    {
                        semaphore.release();
                    }
                    else if ( newState == ConnectionState.RECONNECTED )
                    {
                        latch.countDown();
                    }
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.