本文整理汇总了Java中com.owera.xaps.dbi.UnitJobs类的典型用法代码示例。如果您正苦于以下问题:Java UnitJobs类的具体用法?Java UnitJobs怎么用?Java UnitJobs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnitJobs类属于com.owera.xaps.dbi包,在下文中一共展示了UnitJobs类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startUnitJob
import com.owera.xaps.dbi.UnitJobs; //导入依赖的package包/类
public static void startUnitJob(String unitId, Integer jobId) throws SQLException {
long start = System.currentTimeMillis();
String action = "startUnitJob";
try {
UnitJobs unitJobs = new UnitJobs(DBAccess.getXAPSProperties());
UnitJob uj = new UnitJob(unitId, jobId);
uj.setStartTimestamp(new Date());
boolean updated = unitJobs.start(uj);
if (updated) {
debug("Have started unit-job (job " + jobId + ")");
} else {
error("The unit-job couldn't be started. The reason might it is already COMPLETED_OK state");
}
} catch (Throwable t) {
DBAccess.handleError(action, start, t);
}
}
示例2: stopUnitJob
import com.owera.xaps.dbi.UnitJobs; //导入依赖的package包/类
public static void stopUnitJob(String unitId, Integer jobId, String unitJobStatus) throws SQLException {
long start = System.currentTimeMillis();
String action = "stopUnitJob";
try {
UnitJobs unitJobs = new UnitJobs(DBAccess.getXAPSProperties());
UnitJob uj = new UnitJob(unitId, jobId);
uj.setEndTimestamp(new Date());
uj.setStatus(unitJobStatus);
boolean stopped = unitJobs.stop(uj);
if (stopped) {
debug("Have stopped unit-job (job " + jobId + "), status set to " + unitJobStatus);
} else {
error("The unit-job couldn't be stopped. The reason might be it is deleted or maybe even in COMPLETED_OK state already");
}
} catch (Throwable t) {
DBAccess.handleError(action, start, t);
}
}