Package java.util.concurrent

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


        }
        return true;
      }
    };
    ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
    Future<Boolean> submit = executor.submit(runnable);
    int count = 0;
    while (count < 10)
    {
      try
      {
View Full Code Here


                final AtomicReference<ModelNode> deploymentResults = new AtomicReference<ModelNode>(new ModelNode());
                final CountDownLatch scanDoneLatch = new CountDownLatch(1);
                final CountDownLatch deploymentDoneLatch = new CountDownLatch(1);
                final DeploymentOperations deploymentOps = new BootTimeScannerDeployment(deploymentOperation, deploymentDoneLatch, deploymentResults, scanDoneLatch);

                scheduledExecutorService.submit(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            bootTimeScanner.oneOffScan(deploymentOps);
                        } catch (Throwable t){
View Full Code Here

                if (!keys.removeAll(loadedMounts)) {
                    // nothing was removed from the new list of keys; this
                    // means there are no existing loaded entries that overlap
                    // with the new set
                    if (appInfo.location != null) {
                        futures.add(executor.submit(createContext(appInfo)));
                    }
                    loadedMounts.addAll(keys);
                } else {
                    appInfo.appBarDisplay = false; // disable app bar display on overrided apps
                    Debug.logInfo("Duplicate webapp mount; not loading : " + appInfo.getName() + " / " + appInfo.getLocation(), module);
View Full Code Here

        }
        return true;
      }
    };
    ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
    Future<Boolean> submit = executor.submit(runnable);
    int count = 0;
    while (count < 10) {
      try {
        Thread.sleep(10);
      } catch (InterruptedException e) {
View Full Code Here

                if (!keys.removeAll(loadedMounts)) {
                    // nothing was removed from the new list of keys; this
                    // means there are no existing loaded entries that overlap
                    // with the new set
                    if (appInfo.location != null) {
                        futures.add(executor.submit(createContext(appInfo)));
                    }
                    loadedMounts.addAll(keys);
                } else {
                    appInfo.appBarDisplay = false; // disable app bar display on overrided apps
                    Debug.logInfo("Duplicate webapp mount; not loading : " + appInfo.getName() + " / " + appInfo.getLocation(), module);
View Full Code Here

   public static void assertProcessExits(final boolean sameValue, final int value, final Process p) throws InterruptedException,
                                                                                                   ExecutionException,
                                                                                                   TimeoutException
   {
      ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
      Future<Integer> future = executor.submit(new Callable<Integer>()
      {

         public Integer call() throws Exception
         {
            p.waitFor();
View Full Code Here

            ScheduledExecutorService executorService = getHandler(ScheduledExecutorService.class);
            if (executorService == null || executorService.isShutdown()) {
                return;
            }

            m_future = executorService.submit(new Runnable() {
                private static final String NAME = "ACE Agent Controller";

                @Override
                public void run() {
                    // Annotate the name of the thread for debugging purposes...
View Full Code Here

            ScheduledExecutorService executor = getExecutorService();
            if (executor.isShutdown()) {
                logWarning("Cannot post event, executor is shut down!");
                return;
            }
            executor.submit(new Runnable() {
                @Override
                public void run() {
                    try {
                        listener.handle(topic, eventPayload);
                    }
View Full Code Here

   public static void assertProcessExits(final boolean sameValue, final int value, final Process p) throws InterruptedException,
                                                                                                   ExecutionException,
                                                                                                   TimeoutException
   {
      ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
      Future<Integer> future = executor.submit(new Callable<Integer>()
      {

         public Integer call() throws Exception
         {
            p.waitFor();
View Full Code Here

          }
        }
      }
    });
   
    user.submit(new Callable<Object>() {
      @Override
      public Object call() throws Exception {
        try {
        InetAddress ip = InetAddress.getLocalHost();
        int port = 22222;
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.