本文整理汇总了Java中org.globus.gram.GramJob.request方法的典型用法代码示例。如果您正苦于以下问题:Java GramJob.request方法的具体用法?Java GramJob.request怎么用?Java GramJob.request使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.globus.gram.GramJob
的用法示例。
在下文中一共展示了GramJob.request方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testActiveJobs
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void testActiveJobs() throws Exception {
GramJob job1 = new GramJob(util.get("job.long"));
job1.request(util.get("job.long.contact"));
GramJob job2 = new GramJob(util.get("job.long"));
job2.request(util.get("job.long.contact"));
assertEquals(2, Gram.getActiveJobs());
int i = 0;
while ( Gram.getActiveJobs() != 0 ) {
Thread.sleep(2000);
i++;
if (i == 40) {
fail("getActiveJob() did not reported 0 jobs");
}
}
}
示例2: testBadExecutable
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void testBadExecutable() throws Exception {
GramJob job = new GramJob("&(executable=/bin/thisexecdoesnotexist)");
FailedStatusListener listener = new FailedStatusListener();
job.addListener(listener);
try {
job.request(util.get("job.long.contact"));
} catch (GramException e) {
if (e.getErrorCode() != GramException.EXECUTABLE_NOT_FOUND) {
e.printStackTrace();
fail("Unexpected error returned: " + e.getMessage());
}
logger.debug("Error returned on request()");
return;
}
if (!listener.waitFor(TIMEOUT)) {
fail("Did not get FAILED notification");
}
if (job.getError() != GramException.EXECUTABLE_NOT_FOUND) {
fail("Unexpected error returned: " + job.getError());
}
}
示例3: testTwoPhaseExtend
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void testTwoPhaseExtend() throws Exception {
GramJob job = new GramJob(util.get("job.long") + "(twoPhase=yes)");
try {
job.request(util.get("job.long.contact"));
} catch(WaitingForCommitException e) {
logger.debug("Two phase commit: sending COMMIT_EXTEND signal");
job.signal(GramJob.SIGNAL_COMMIT_EXTEND, "30");
}
logger.debug("job submited: " + job.getIDAsString());
Thread.sleep(75000);
if (job.getStatus() == job.STATUS_FAILED) {
fail("Timeout expired!");
}
}
示例4: multiRunSub
import org.globus.gram.GramJob; //导入方法依赖的package包/类
private void multiRunSub(String rsl, String rmc, MultiJobListener listener)
throws InvalidSecurityContextException, TaskSubmissionException {
GramJob job = new GramJob(rsl);
job.addListener(listener);
try {
job.setCredentials(this.credential);
}
catch (IllegalArgumentException iae) {
throw new InvalidSecurityContextException(
"Cannot set the SecurityContext twice", iae);
}
boolean limitedDeleg = isLimitedDelegation(this.securityContext);
try {
job.request(rmc, false, limitedDeleg);
if (logger.isDebugEnabled()) {
logger.debug("Submitted job with Globus ID: "
+ job.getIDAsString());
}
}
catch (GramException ge) {
listener.failed(true);
throw new TaskSubmissionException("Cannot submit job", ge);
}
catch (GSSException gsse) {
listener.failed(true);
throw new InvalidSecurityContextException("Invalid GSSCredentials",
gsse);
}
listener.runningJob();
}
示例5: testBadParameter
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void testBadParameter() throws Exception {
GramJob job = new GramJob("&(argument=12)");
try {
job.request(util.get("job.long.contact"));
} catch (GramException e) {
if (e.getErrorCode() != GramException.PARAMETER_NOT_SUPPORTED) {
e.printStackTrace();
fail("Unexpected error returned: " + e.getMessage());
}
}
}
示例6: testBind
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void testBind() throws Exception {
GramJob job = new
GramJob(util.get("job.long"));
logger.debug("submitting job in batch mode...");
job.request(util.get("job.long.contact"), true);
logger.debug("job submitted: " + job.getIDAsString());
DoneStatusListener listener = new DoneStatusListener();
job.addListener(listener);
job.bind();
if (!listener.waitFor(TIMEOUT)) {
fail("Did not get DONE notification");
}
}
示例7: 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");
}
}
示例8: 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.");
}
}
示例9: 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, " ");
}
}