本文整理汇总了Java中javax.batch.operations.NoSuchJobInstanceException类的典型用法代码示例。如果您正苦于以下问题:Java NoSuchJobInstanceException类的具体用法?Java NoSuchJobInstanceException怎么用?Java NoSuchJobInstanceException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NoSuchJobInstanceException类属于javax.batch.operations包,在下文中一共展示了NoSuchJobInstanceException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJobExecutions
import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
@Override
public List<JobExecution> getJobExecutions(JobInstance instance)
throws NoSuchJobInstanceException, JobSecurityException {
List<JobExecution> executions = new ArrayList<JobExecution>();
if (isAuthorized(instance.getInstanceId())) {
// Mediate between one
List<IJobExecution> executionImpls = persistenceService.jobOperatorGetJobExecutions(instance.getInstanceId());
if (executionImpls.size() == 0 ){
logger.warning("The current user is not authorized to perform this operation");
throw new NoSuchJobInstanceException( "Job: " + instance.getJobName() + " does not exist");
}
for (IJobExecution e : executionImpls) {
executions.add(e);
}
} else {
logger.warning("The current user is not authorized to perform this operation");
throw new JobSecurityException("The current user is not authorized to perform this operation");
}
return executions;
}
示例2: getMostRecentZerothPartitionSubJobInstanceId
import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
private long getMostRecentZerothPartitionSubJobInstanceId(long rootJobInstanceId, String stepName) {
StringBuilder sb = new StringBuilder(":");
sb.append(Long.toString(rootJobInstanceId));
sb.append(":");
sb.append(stepName);
sb.append(":0");
String zerothPartitionSubJobName = sb.toString();
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
long instanceId = 0;
try {
conn = getConnection();
statement = conn.prepareStatement("select max(jobinstanceid) as mostrecentid from jobinstancedata where name = ?");
statement.setObject(1, zerothPartitionSubJobName);
rs = statement.executeQuery();
if (rs.next()) {
instanceId = rs.getLong("mostrecentid");
} else {
String msg = "Did not find sub job instance named = " + zerothPartitionSubJobName;
logger.fine(msg);
throw new NoSuchJobInstanceException(msg);
}
} catch (SQLException e) {
throw new PersistenceException(e);
} finally {
cleanupConnection(conn, rs, statement);
}
return instanceId;
}
示例3: getJobExecutions
import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
@Override
public List<JobExecution> getJobExecutions(final JobInstance instance)
throws NoSuchJobInstanceException, JobSecurityException {
// Mediate between one
final List<JobExecution> executions = new ArrayList<JobExecution>();
List<InternalJobExecution> executionImpls = persistenceManagerService.jobOperatorGetJobExecutions(instance.getInstanceId());
if (executionImpls.size() == 0) {
throw new NoSuchJobInstanceException("Job: " + instance.getJobName() + " does not exist");
}
for (InternalJobExecution e : executionImpls) {
executions.add(e);
}
return executions;
}
示例4: getJobExecutions
import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
public List<JobExecution> getJobExecutions(JobInstance instance) throws NoSuchJobInstanceException, JobSecurityException {
return jobOp.getJobExecutions(instance);
}
示例5: abandonJobExecution
import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
public void abandonJobExecution(long executionId) throws NoSuchJobInstanceException, JobExecutionIsRunningException, JobSecurityException, NoSuchJobExecutionException {
jobOp.abandon(executionId);
}
示例6: getParameters
import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
public Properties getParameters(long executionId) throws NoSuchJobInstanceException, JobSecurityException, NoSuchJobExecutionException{
return jobOp.getParameters(executionId);
}
示例7: getJobExecutions
import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
@Override
public List<JobExecution> getJobExecutions(final JobInstance jobInstance) throws NoSuchJobInstanceException, JobSecurityException {
return getOrCreateDelegate().getJobExecutions(jobInstance);
}