Package java.util.concurrent

Examples of java.util.concurrent.ScheduledExecutorService.shutdown()


            sr.unregister();

            eventAdmin.stop();

            executor.shutdown();
            scheduledExecutor.shutdown();
        }
    }

    @Test
    public void testWildcard() throws Exception
View Full Code Here


                mk.commit("/a/b/c/d/e", "+\"f\" : {}", mk.getHeadRevision(), null);
                Thread.sleep(30);
                mk.commit("/a/b/c/d", "-\"e\"", mk.getHeadRevision(), null);
            }
        } finally {
            gcExecutor.shutdown();
        }
    }

    /**
     * Verify garbage collection can run concurrently with branch & merge.
View Full Code Here

                }
                Thread.sleep(30);
                mk.merge(branchId, null);
            }
        } finally {
            gcExecutor.shutdown();
        }
    }

    /**
     * Parses the provided string into a {@code JSONArray}.
View Full Code Here

  }

  public void testShutdownIsPropagatedToTheExecutorOnDestroy() throws Exception {
    MockControl mockScheduledExecutorService = MockControl.createNiceControl(ScheduledExecutorService.class);
    final ScheduledExecutorService executor = (ScheduledExecutorService) mockScheduledExecutorService.getMock();
    executor.shutdown();
    mockScheduledExecutorService.setVoidCallable();
    mockScheduledExecutorService.replay();

    ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() {
      protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) {
View Full Code Here

        // wake up threads waiting on this instance's monitor (e.g. workspace janitor)
        notifyAll();

        // Shut down the executor service
        ScheduledExecutorService executor = context.getExecutor();
        executor.shutdown();
        try {
            // Wait for all remaining background threads to terminate
            if (!executor.awaitTermination(10, TimeUnit.SECONDS)) {
                log.warn("Attempting to forcibly shutdown runaway threads");
                executor.shutdownNow();
View Full Code Here

                    totalPu = totalPu+1;
                }
               
                if(totalPs!=0 && menu.getMenuComponentCount()==(totalPs+totalPu+5)) {   
                    menu.add(coverScreenMI);
                    exec.shutdown();
                }
            }
        }, 0, 1, TimeUnit.SECONDS);
    }
View Full Code Here

                        }

                        if(totalPs!=0 && menu.getMenuComponentCount()==(totalPs+totalPu+mp)) {

                            menu.add(coverScreenMI);
                            exec.shutdown();
                        }
                    } catch(Exception e) {
                        e.printStackTrace();
                    }
                }
View Full Code Here

    addListener(new Listener() {
      @Override public void starting() {}
      @Override public void running() {}
      @Override public void stopping(State from) {}
      @Override public void terminated(State from) {
        executor.shutdown();
      }
      @Override public void failed(State from, Throwable failure) {
        executor.shutdown();
      }}, MoreExecutors.sameThreadExecutor());
    return executor;
View Full Code Here

      @Override public void stopping(State from) {}
      @Override public void terminated(State from) {
        executor.shutdown();
      }
      @Override public void failed(State from, Throwable failure) {
        executor.shutdown();
      }}, MoreExecutors.sameThreadExecutor());
    return executor;
  }

  /**
 
View Full Code Here

        assertEquals("result count", itemSize, pool.getResultCount());
        for (int i = 0; i < itemSize; i++) {
            TestItem item = items.get(i);
            assertEquals("item(" + i + ") result", Integer.toString(i), pool.getResult(item));
        }
        executor.shutdown();
    }

    private static class TestItem implements DependencyPool.Item<TestItem, Integer, String> {
        private final DependencyPool pool;
        private final Integer key;
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.