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

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

Best Java code snippets using org.infinispan.executors.ExecutorAllCompletionService.isAllCompleted (Showing top 4 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-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 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 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 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.executorsExecutorAllCompletionServiceisAllCompleted

Popular methods of ExecutorAllCompletionService

  • <init>
  • getFirstException
  • isExceptionThrown
  • submit
  • waitUntilAllCompleted

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • JComboBox (javax.swing)
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
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