Examples of ExecutionProblem


Examples of org.globus.workspace.client_core.ExecutionProblem

        try {
            final GlobusURL source = new GlobusURL(sourceUrlString);
            urlcopy.setSourceUrl(source);
        } catch (Exception e) {
            throw new ExecutionProblem("Problem constructing source URL: " +
                                                e.getMessage());
        }

        try {
            final GlobusURL dest = new GlobusURL(destUrlString);
            urlcopy.setDestinationUrl(dest);
        } catch (Exception e) {
            throw new ExecutionProblem("Problem constructing destination " +
                                       "URL: " + e.getMessage());
        }

        if (identityAuthorization == null) {
            urlcopy.setDestinationAuthorization(
                            HostAuthorization.getInstance());

            if (debug != null) {
                debug.println(
                        "Using host-based authorization of remote server");
            }
        } else {
            final IdentityAuthorization idA =
                    new IdentityAuthorization(identityAuthorization);
            urlcopy.setDestinationAuthorization(idA);
            if (debug != null) {
                debug.println("Using identity-based authorization of remote " +
                        "server: '" + identityAuthorization + "'");
            }
        }

        PrintStream pr = null;
        if (info != null) {
            pr = info;
        } else if (debug != null) {
            pr = debug;
        }

        if (pr != null) {
            pr.println("\nTransferring");
            pr.println("  - Source: " + sourceUrlString);
            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++) {
            if (tasks[i] != null) {
                executorService.submit(tasks[i]);
            }
        }

        for (int i = 0; i < tasks.length; i++) {
            if (tasks[i] != null) {
                // all tasks currently return null
                try {
                    if (timeoutMinutes < 1) {
                        tasks[i].get();
                    } else {
                        tasks[i].get(timeoutMinutes, TimeUnit.MINUTES);
                    }
                } catch (InterruptedException e) {
                    throw new ExecutionProblem(e);
                } catch (ExecutionException e) {
                    throw new ExecutionProblem("Problem transferring: " +
                                                        e.getMessage());
                } catch (TimeoutException e) {
                    throw new ExecutionProblem("Timeout limit exceeded.");
                }
            }
        }

        if (info != null) {
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.