Package java.util.concurrent

Examples of java.util.concurrent.ExecutorService.shutdownNow()


            }
            assertTrue("All channels were succefully connected",successConnecting);    
        }
        finally {
            Util.sleep(2500);
            executor.shutdownNow();
            log.info("closing channels: ");           
            for(JChannel ch:channels) {
                ch.close();                              
                //there are sometimes big delays until entire cluster shuts down
                //use sleep to make a smoother shutdown so we avoid false positives
View Full Code Here


            final Future<JoinTable> future = ex.submit(call);
            final Sequence<? extends Item> mapped;
            try {
                mapped = map(contextSeq, dynEnv, future);
            } catch (InterruptedException e) {
                ex.shutdownNow();
                throw new IllegalStateException(e);
            } catch (ExecutionException e) {
                ex.shutdownNow();
                throw new IllegalStateException(e);
            }
View Full Code Here

                mapped = map(contextSeq, dynEnv, future);
            } catch (InterruptedException e) {
                ex.shutdownNow();
                throw new IllegalStateException(e);
            } catch (ExecutionException e) {
                ex.shutdownNow();
                throw new IllegalStateException(e);
            }
            ex.shutdown(); // REVIEWME is really required?
            return mapped;
        }
View Full Code Here

      });
    }
    synchronized (waitLock) {
      waitLock.notifyAll();
    }
    executorService.shutdownNow();
    assertNull(error.get());
  }

  @Test
  public void testCheckAndPut() throws IOException {
View Full Code Here

        isRunning = false;
      }

    }

    es.shutdownNow();

    try {
      // Wait at most 10 seconds for the remaining tasks to finish
      es.awaitTermination(10, TimeUnit.SECONDS);
    }
View Full Code Here

                e.printStackTrace();
            }

            this.hasCompleted = true;
            this.elapsedTimeNs = System.nanoTime() - start;
            executor.shutdownNow();
            try {
                executor.awaitTermination(3, TimeUnit.SECONDS);
            } catch(InterruptedException e) {}
        } finally {
            tearDown();
View Full Code Here

        c.sendMessage("foo-1", "hello there");
        c.close();

        Thread.sleep(7000);
        bg.shutdownNow();
        Thread.sleep(1000);

        System.out.printf("\n\n");
        walkFileTree(new File(basePath).toPath(),
                new FileVisitor<Path>() {
View Full Code Here

        }

        mockJSON.reset();
        mockXML.reset();

        executor.shutdownNow();
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
View Full Code Here

         });
      }

      executor.shutdown();
      executor.awaitTermination(20, TimeUnit.SECONDS);
      executor.shutdownNow();

      assertEquals(NUMBER_OF_THREADS * REQUESTS_PER_THREAD, successCounter.get());

   }
}
View Full Code Here

        }

        // Wait for all inserts to happen and stop connections and progress tracking
        pendingInserts.await();
        openConnectionsWatcherExecutor.shutdownNow();
        progressReportExecutor.shutdownNow();

        if (negativeOpenConnectionCountSpotted.get()) {
            fail("Negative value spotted for open connection count");
        }
    }
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.