Tabnine Logo
ExecutorAllCompletionService.waitUntilAllCompleted
Code IndexAdd Tabnine 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)

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

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • putExtra (Intent)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Menu (java.awt)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Sublime Text 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