congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ExecutorAllCompletionService.isExceptionThrown
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.infinispan/infinispan-cachestore-jpa

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

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

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.executorsExecutorAllCompletionServiceisExceptionThrown

Popular methods of ExecutorAllCompletionService

  • <init>
  • getFirstException
  • submit
  • waitUntilAllCompleted
  • isAllCompleted

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • setScale (BigDecimal)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now