Package org.globus.gram

Examples of org.globus.gram.GramJob


            if (enableTwoPhase) {
                rsl = rsl + "(twoPhase=yes)";
            }

            log.debug("RSL = " + rsl);
            GramJob job = new GramJob(rsl);
            return job;
        } catch (ToolsException te) {
            throw new GFacProviderException(te.getMessage(), te);
        }
    }
View Full Code Here


    private void cancelSingleJob(String jobId, JobExecutionContext context) throws GFacException {
        // First check whether job id is in the cache
        if (currentlyExecutingJobCache.containsKey(jobId)) {

            synchronized (this) {
                GramJob gramJob = currentlyExecutingJobCache.get(jobId);

                // Even though we check using containsKey, at this point job could be null
                if (gramJob != null && (gramJob.getStatus() != GRAMConstants.STATUS_DONE ||
                        gramJob.getStatus() != GRAMConstants.STATUS_FAILED)) {
                    cancelJob(gramJob, context);
                }
            }

        } else {

            try {
        GSSCredential gssCred = ((GSISecurityContext)context.
                getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).getGssCredentials();

        GramJob gramJob = new GramJob(null);
        try {
            gramJob.setID(jobId);
        } catch (MalformedURLException e) {
            throw new GFacException("Invalid job id - " + jobId, e);
        }
        gramJob.setCredentials(gssCred);

        synchronized (this) {
            if (gramJob.getStatus() != GRAMConstants.STATUS_DONE ||
                    gramJob.getStatus() != GRAMConstants.STATUS_FAILED) {
                cancelJob(gramJob, context);
            }
        }
      } catch (ApplicationSettingsException e) {
        throw new GFacException(e);
View Full Code Here

            GramAttributes jobAttr = GramRSLGenerator.configureRemoteJob(invocationContext);
            String rsl = jobAttr.toRSL();

            log.info("RSL = " + rsl);

            job = new GramJob(rsl);
            listener = new JobSubmissionListener(job, invocationContext);
            job.addListener(listener);

        } catch (ToolsException te) {
            throw new ProviderException(te.getMessage(), te);
View Full Code Here

            GramAttributes jobAttr = GramRSLGenerator.configureRemoteJob(invocationContext);
            String rsl = jobAttr.toRSL();

            log.info("RSL = " + rsl);

            job = new GramJob(rsl);
            listener = new JobSubmissionListener(job, invocationContext);
            job.addListener(listener);

        } catch (ToolsException te) {
            throw new ProviderException(te.getMessage(), te);
View Full Code Here

    private void cancelSingleJob(String jobId, JobExecutionContext context) throws GFacException {
        // First check whether job id is in the cache
        if (currentlyExecutingJobCache.containsKey(jobId)) {

            synchronized (this) {
                GramJob gramJob = currentlyExecutingJobCache.get(jobId);

                // Even though we check using containsKey, at this point job could be null
                if (gramJob != null && (gramJob.getStatus() != GRAMConstants.STATUS_DONE ||
                        gramJob.getStatus() != GRAMConstants.STATUS_FAILED)) {
                    cancelJob(gramJob, context);
                }
            }

        } else {

            GSSCredential gssCred = ((GSISecurityContext)context.
                    getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).getGssCredentials();

            GramJob gramJob = new GramJob(null);
            try {
                gramJob.setID(jobId);
            } catch (MalformedURLException e) {
                throw new GFacException("Invalid job id - " + jobId, e);
            }
            gramJob.setCredentials(gssCred);

            synchronized (this) {
                if (gramJob.getStatus() != GRAMConstants.STATUS_DONE ||
                        gramJob.getStatus() != GRAMConstants.STATUS_FAILED) {
                    cancelJob(gramJob, context);
                }
            }
        }
    }
View Full Code Here

            if (enableTwoPhase) {
                rsl = rsl + "(twoPhase=yes)";
            }

            log.debug("RSL = " + rsl);
            GramJob job = new GramJob(rsl);
            return job;
        } catch (ToolsException te) {
            throw new GFacProviderException(te.getMessage(), te);
        }
    }
View Full Code Here

  "(directory=" + execDir + ")" +
  "(stdout=" + stdOut + ")" +
  "(stderr=" + stdErr + ")";
     
      // create a Gram Job
      GramJob theJob = new GramJob(theRSL);

      // if a proxy is passed via the typeMap, use it
      String proxyPath = properties.getString("X509_USER_PROXY", "None");
      if(!proxyPath.equals("None")) {
  File f = new File(proxyPath);
  byte [] data = new byte[(int) f.length()];
  FileInputStream in = new FileInputStream(f);
  // read in the credential data
  in.read(data);
  in.close();
 
  ExtendedGSSManager manager =
    (ExtendedGSSManager) ExtendedGSSManager.getInstance();
  GSSCredential proxy =
    manager.createCredential(data,
           ExtendedGSSCredential.IMPEXP_OPAQUE,
           GSSCredential.DEFAULT_LIFETIME,
           null, // use default mechanism - GSI
           GSSCredential.INITIATE_AND_ACCEPT);
  theJob.setCredentials(proxy);
      }

      // request execution of the job
      boolean NOT_BATCH = false;
      boolean NOT_LIMITED = false;
View Full Code Here

TOP

Related Classes of org.globus.gram.GramJob

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.