当前位置: 首页>>代码示例>>Java>>正文


Java GramJob.cancel方法代码示例

本文整理汇总了Java中org.globus.gram.GramJob.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java GramJob.cancel方法的具体用法?Java GramJob.cancel怎么用?Java GramJob.cancel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.globus.gram.GramJob的用法示例。


在下文中一共展示了GramJob.cancel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cancel

import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void cancel(String message) throws InvalidSecurityContextException,
        TaskSubmissionException {
    try {
        if (getTask().getStatus().getStatusCode() == Status.UNSUBMITTED) {
            getTask().setStatus(new StatusImpl(Status.CANCELED, message, null));
            return;
        }
        String jobCount = (String) getTask().getAttribute("jobCount");
        if (jobCount.equalsIgnoreCase("multiple")) {
            Iterator iterator = this.jobList.iterator();
            while (iterator.hasNext()) {
                GramJob job = (GramJob) iterator.next();
                job.cancel();
            }
        } else {
            this.gramJob.cancel();
        }
        getTask().setStatus(new StatusImpl(Status.CANCELED, message, null));
    } catch (GramException ge) {
        cleanup();
        throw new TaskSubmissionException("Cannot cancel job", ge);
    } catch (GSSException gsse) {
        cleanup();
        throw new InvalidSecurityContextException("Invalid GSSCredentials",
                gsse);
    }
}
 
开发者ID:swift-lang,项目名称:swift-k,代码行数:28,代码来源:JobSubmissionTaskHandler.java

示例2: cancel

import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void cancel(String message) throws InvalidSecurityContextException,
        TaskSubmissionException {
    try {
        if (getTask().getStatus().getStatusCode() == Status.UNSUBMITTED) {
            getTask().setStatus(
                new StatusImpl(Status.CANCELED, message, null));
            return;
        }
        String jobCount = (String) getTask().getAttribute("jobCount");
        if (jobCount.equalsIgnoreCase("multiple")) {
            for (GramJob job : jobList) {
                job.cancel();
            }
        }
        else {
            this.gramJob.cancel();
        }
        getTask().setStatus(new StatusImpl(Status.CANCELED, message, null));
    }
    catch (GramException ge) {
        cleanup();
        throw new TaskSubmissionException("Cannot cancel job", ge);
    }
    catch (GSSException gsse) {
        cleanup();
        throw new InvalidSecurityContextException("Invalid GSSCredentials",
            gsse);
    }
}
 
开发者ID:swift-lang,项目名称:swift-k,代码行数:30,代码来源:JobSubmissionTaskHandler.java

示例3: testCancel

import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void testCancel() throws Exception {

GramJob job = new
    GramJob(util.get("job.long"));

FailedStatusListener listener = new FailedStatusListener();

job.addListener(listener);

logger.debug("submitting job in interactive mode...");
job.request(util.get("job.long.contact"));
logger.debug("job submitted: " + job.getIDAsString());

Thread.sleep(5000);

job.cancel();

if (!listener.waitFor(TIMEOUT)) {
    fail("Did not get FAILED notification");
}
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:22,代码来源:GramTest.java

示例4: testUnbind

import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void testUnbind() throws Exception {

GramJob job = new
    GramJob(util.get("job.long"));

ActiveStatusListener listener = new ActiveStatusListener();

job.addListener(listener);

logger.debug("submitting job in interactive mode...");
job.request(util.get("job.long.contact"));
logger.debug("job submitted: " + job.getIDAsString());

if (!listener.waitFor(TIMEOUT)) {
    fail("Did not get ACTIVE notification");
}

job.unbind();
listener.reset();

Thread.sleep(2000);

job.cancel();

if (listener.getNotified()) {
    fail("Unconnected listener received unexpected notification.");
}
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:29,代码来源:GramTest.java

示例5: twoPhaseSubmit

import org.globus.gram.GramJob; //导入方法依赖的package包/类
private void twoPhaseSubmit(boolean cancelCall) throws Exception {

       GramJob job = new GramJob(util.get("job.long") + "(twoPhase=yes)");

       try {
           job.request(util.get("job.long.contact"));

           fail("Did not throw expected exception");
} catch(WaitingForCommitException e) {
    logger.debug("Two phase commit: sending COMMIT_REQUEST signal");

           job.signal(GramJob.SIGNAL_COMMIT_REQUEST);
}

       logger.debug("job submited: " + job.getIDAsString());

       Thread.sleep(5000);

// this is little weird... cancel() and signal_cancel() should
       // behave in the same exact way but they do not

       if (cancelCall) {
           logger.debug("Canceling job... (cancel call)");

           job.cancel();

           // XXX: this should be common to both ways
           logger.debug("Two phase commit: sending COMMIT_END signal");
           
           job.signal(GramJob.SIGNAL_COMMIT_END);
       } else {
           logger.debug("Canceling job... (cancel signal)");

           job.signal(GramJob.SIGNAL_CANCEL, " ");
}
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:37,代码来源:GramTest.java


注:本文中的org.globus.gram.GramJob.cancel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。