本文整理汇总了Java中org.globus.gram.GramJob.getError方法的典型用法代码示例。如果您正苦于以下问题:Java GramJob.getError方法的具体用法?Java GramJob.getError怎么用?Java GramJob.getError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.globus.gram.GramJob
的用法示例。
在下文中一共展示了GramJob.getError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
}
示例2: statusChanged
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void statusChanged(GramJob job) {
int status = job.getStatus();
switch (status) {
case 2:
getTask().setStatus(Status.ACTIVE);
break;
case 4:
int errorCode = job.getError();
Exception e = new Exception("Error code: " + errorCode);
failTask(null, e);
break;
case 8:
getTask().setStatus(Status.COMPLETED);
break;
case 16:
getTask().setStatus(Status.SUSPENDED);
break;
case 32:
getTask().setStatus(Status.UNSUBMITTED);
break;
default:
break;
}
if ((status == 4) || (status == 8)) {
cleanup();
}
}
示例3: statusChanged
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public void statusChanged(GramJob job) {
int status = job.getStatus();
switch (status) {
case GRAMConstants.STATUS_ACTIVE:
getTask().setStatus(Status.ACTIVE);
break;
case GRAMConstants.STATUS_FAILED:
int errorCode = job.getError();
Exception e = new GramException(errorCode);
failTask(null, e);
break;
case GRAMConstants.STATUS_DONE:
getTask().setStatus(Status.COMPLETED);
break;
case GRAMConstants.STATUS_SUSPENDED:
getTask().setStatus(Status.SUSPENDED);
break;
case GRAMConstants.STATUS_UNSUBMITTED:
getTask().setStatus(Status.UNSUBMITTED);
break;
default:
break;
}
if ((status == GRAMConstants.STATUS_FAILED)
|| (status == GRAMConstants.STATUS_DONE)) {
cleanup();
}
}
示例4: statusChanged
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public synchronized void statusChanged(GramJob job) {
if (!called) {
called = true;
status = job.getStatus();
error = job.getError();
notify();
}
}
示例5: statusChanged
import org.globus.gram.GramJob; //导入方法依赖的package包/类
public synchronized void statusChanged(GramJob job) {
int st = job.getStatus();
logger.debug("Gass job status: " + st);
if (status == -1 && isStartState(st)) {
status = st;
error = job.getError();
notify();
}
}