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


Java NoSuchJobInstanceException类代码示例

本文整理汇总了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;
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:23,代码来源:JobOperatorImpl.java

示例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;
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:36,代码来源:JDBCPersistenceManagerImpl.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:16,代码来源:JobOperatorImpl.java

示例4: getJobExecutions

import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
public List<JobExecution> getJobExecutions(JobInstance instance) throws NoSuchJobInstanceException, JobSecurityException {
	return jobOp.getJobExecutions(instance);
}
 
开发者ID:WASdev,项目名称:standards.jsr352.tck,代码行数:4,代码来源:JobOperatorBridge.java

示例5: abandonJobExecution

import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
public void abandonJobExecution(long executionId) throws NoSuchJobInstanceException, JobExecutionIsRunningException, JobSecurityException, NoSuchJobExecutionException {
	jobOp.abandon(executionId);        
}
 
开发者ID:WASdev,项目名称:standards.jsr352.tck,代码行数:4,代码来源:JobOperatorBridge.java

示例6: getParameters

import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
public Properties getParameters(long executionId) throws NoSuchJobInstanceException, JobSecurityException, NoSuchJobExecutionException{
	return jobOp.getParameters(executionId);
}
 
开发者ID:WASdev,项目名称:standards.jsr352.tck,代码行数:4,代码来源:JobOperatorBridge.java

示例7: getJobExecutions

import javax.batch.operations.NoSuchJobInstanceException; //导入依赖的package包/类
@Override
public List<JobExecution> getJobExecutions(final JobInstance jobInstance) throws NoSuchJobInstanceException, JobSecurityException {
    return getOrCreateDelegate().getJobExecutions(jobInstance);
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:5,代码来源:SynchronousJobOperator.java


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