Codota Logo
ExecutorAllCompletionService.waitUntilAllCompleted
Code IndexAdd Codota to your IDE (free)

How to use
waitUntilAllCompleted
method
in
org.infinispan.executors.ExecutorAllCompletionService

Best Java code snippets using org.infinispan.executors.ExecutorAllCompletionService.waitUntilAllCompleted (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.infinispan/infinispan-cachestore-jpa

  emStream.close();
eacs.waitUntilAllCompleted();
if (eacs.isExceptionThrown()) {
  throw new JpaStoreException(eacs.getFirstException());
origin: org.infinispan/infinispan-embedded-query

eacs.waitUntilAllCompleted();
if (eacs.isExceptionThrown()) {
  throw new PersistenceException("Execution exception!", eacs.getFirstException());
origin: org.infinispan/infinispan-lucene-v3

eacs.waitUntilAllCompleted();
if (eacs.isExceptionThrown()) {
  throw new PersistenceException("Execution exception!", eacs.getFirstException());
origin: org.infinispan/infinispan-core

public void testParallelWait() throws InterruptedException {
 final ExecutorAllCompletionService service = createService(2);
 for (int i = 0; i < 300; ++i) {
   service.submit(new WaitRunnable(10), null);
 }
 List<Thread> threads = new ArrayList<>(10);
 for (int i = 0; i < 10; ++i) {
   Thread t = new Thread(() -> {
    service.waitUntilAllCompleted();
    assertTrue(service.isAllCompleted());
    assertFalse(service.isExceptionThrown());
   });
   threads.add(t);
   t.start();
 }
 for (Thread t : threads) {
   t.join();
 }
 assertTrue(service.isAllCompleted());
 assertFalse(service.isExceptionThrown());
}
origin: org.infinispan/infinispan-core

public void testWaitForAll() {
 ExecutorAllCompletionService service = createService(1);
 long before = System.currentTimeMillis();
 service.submit(new WaitRunnable(500), null);
 service.submit(new WaitRunnable(500), null);
 service.waitUntilAllCompleted();
 long after = System.currentTimeMillis();
 assertTrue(after - before >= 1000);
 assertTrue(service.isAllCompleted());
 assertFalse(service.isExceptionThrown());
}
origin: org.infinispan/infinispan-core

public void testParallelException() throws InterruptedException {
 final ExecutorAllCompletionService service = createService(2);
 for (int i = 0; i < 150; ++i) {
   service.submit(new WaitRunnable(10), null);
 }
 service.submit(new ExceptionRunnable("foobar"), null);
 for (int i = 0; i < 150; ++i) {
   service.submit(new WaitRunnable(10), null);
 }
 List<Thread> threads = new ArrayList<>(10);
 for (int i = 0; i < 10; ++i) {
   Thread t = new Thread(() -> {
    service.waitUntilAllCompleted();
    assertTrue(service.isAllCompleted());
    assertTrue(service.isExceptionThrown());
   });
   threads.add(t);
   t.start();
 }
 for (Thread t : threads) {
   t.join();
 }
 assertTrue(service.isAllCompleted());
 assertTrue(service.isExceptionThrown());
}
origin: org.infinispan/infinispan-core

public void testExceptions() {
 ExecutorAllCompletionService service = createService(1);
 service.submit(new WaitRunnable(1), null);
 service.submit(new ExceptionRunnable("second"), null);
 service.submit(new WaitRunnable(1), null);
 service.submit(new ExceptionRunnable("third"), null);
 service.waitUntilAllCompleted();
 assertTrue(service.isAllCompleted());
 assertTrue(service.isExceptionThrown());
 assertEquals("second", findCause(service.getFirstException()).getMessage());
}
org.infinispan.executorsExecutorAllCompletionServicewaitUntilAllCompleted

Popular methods of ExecutorAllCompletionService

  • <init>
  • getFirstException
  • isExceptionThrown
  • submit
  • isAllCompleted

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now