Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.FutureTask


    }

    private void launchTerminationWaiter() {
        final LatchWaiter waiter = new LatchWaiter(this.getTerminationLatch(),
                                                   this.exitLatch);
        this.terminationWaiter = new FutureTask(waiter);
        this.executor.submit(this.terminationWaiter);
    }
View Full Code Here


            pr.println("  - Destination: " + destUrlString);
            pr.println();
        }

        final FutureTask[] tasks = new FutureTask[2];
        tasks[0] = new FutureTask(new CopyTask(urlcopy));

        if (info != null) {
            tasks[1] = new FutureTask(new CopyWatchTask(info, debug));
        } else {
            tasks[1] = null;
        }

        for (int i = 0; i < tasks.length; i++) {
View Full Code Here

        }

        print.infoln("Querying for '" + dirName + "' information:");
        print.infoln("  - Workspace handle (EPR): '" + eprPath + "'");

        final FutureTask task =
                new FutureTask(
                        new QueryTask(eprPath, idAuthz, shortName,
                                      print));
       
        this.executor.submit(task);

        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
View Full Code Here

        if (!ipIdDir.exists()) {
            throw new ExecutionProblem("Could not find the 'id-ip-dir' for this handle, " +
                    "was it a virtual cluster launched with the context broker?");
        }

        final FutureTask task =
                new FutureTask(
                        new PrintContextStatusTask(eprPath, brokerIdAuthz, shortName,
                                             ipIdDirPath, print));

        this.executor.submit(task);

        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
View Full Code Here

        final Print newprint = new Print(newOpts,
                                         print.getInfoProxy(),
                                         print.getErrProxy(),
                                         print.getDebugProxy());

        final FutureTask task =
                new FutureTask(
                        new FactoryQueryTask(workspaceFactoryURL,
                                             factoryID,
                                             newprint));

        this.executor.submit(task);

        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
View Full Code Here

                                            pollMs,
                                            disableAllStateChecks,
                                            shortName,
                                            print);

        final FutureTask task = new FutureTask(sTask);
        this.executor.submit(task);

        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
View Full Code Here

        final DestroyTask dTask = new DestroyTask(eprPath,
                                                  identityAuthorization,
                                                  dirName,
                                                  print);

        final FutureTask task = new FutureTask(dTask);
        this.executor.submit(task);

        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
View Full Code Here

            final RunTask[] runTasks = cloud.generateRunTasks(brokerContact,
                cloudDirPath, sshKeyPath, durationMinutes, print);
            final FutureTask[] futureTasks = new FutureTask[runTasks.length];
            for (int taskIndex = 0; taskIndex < futureTasks.length; taskIndex++) {
                futureTasks[taskIndex] = new FutureTask(runTasks[taskIndex]);
            }

            final String ensembleEprPath = runTasks[0].getEnsembleEprPath();

            final String identAuth = cloud.getCloud().getFactoryID();
View Full Code Here

                                      contactPath,
                                      expectInjections,
                                      brokerID,
                                      print);

        final FutureTask task = new FutureTask(ccTask);
       

        this.executor.submit(task);

        final BrokerContactType brokerContact;
        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() == BaseClient.SUCCESS_EXIT_CODE) {
                brokerContact =
                        FileUtils.getBrokerContactFromFile(print,
                                                           contactPath);
                print.infoln("\nCreated new context with broker.");
View Full Code Here

        final DestroyTask dTask = new DestroyTask(ensembleEprPath,
                                                  identityAuthorization,
                                                  clusterName,
                                                  print);

        final FutureTask task = new FutureTask(dTask);
        this.executor.submit(task);

        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
View Full Code Here

TOP

Related Classes of edu.emory.mathcs.backport.java.util.concurrent.FutureTask

Copyright © 2018 www.massapicom. 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.