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


Java JobOperator.getJobInstances方法代码示例

本文整理汇总了Java中javax.batch.operations.JobOperator.getJobInstances方法的典型用法代码示例。如果您正苦于以下问题:Java JobOperator.getJobInstances方法的具体用法?Java JobOperator.getJobInstances怎么用?Java JobOperator.getJobInstances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.batch.operations.JobOperator的用法示例。


在下文中一共展示了JobOperator.getJobInstances方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doRun

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
@Override
public void doRun() {
    final JobOperator operator = operator();
    final long total = operator.getJobInstanceCount(name);
    info(name + " has " + total + " job instances");

    info("");
    info("instance id");
    info("-----------");
    final List<JobInstance> id = operator.getJobInstances(name, start, count);
    if (id != null) {
        for (final JobInstance instance : id) {
            info(Long.toString(instance.getInstanceId()));
        }
        info("-----------");
        info("Current/Total: " + (start + id.size()) + "/" + operator.getJobInstanceCount(name));
    } else {
        info("No instance found.");
    }
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:21,代码来源:Instances.java

示例2: displayJobDetails

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
private void displayJobDetails(PrintWriter pw) {
    pw.println("<table>");
    pw.println("<tr><td>Status of Submitted Jobs</td></tr>");
    pw.println("<table border=\"yes\">");
    pw.println("<tr><td>Job Name</td><td>ExecutionID</td>"
            + "<td>Batch Status</td><td>Exit Status</td>"
            + "<td>Start Time Status</td><td>End Time</td>"
                + "</tr>");

    JobOperator jobOperator = BatchRuntime.getJobOperator();
    try {
        for (JobInstance jobInstance : jobOperator.getJobInstances("payroll", 0, Integer.MAX_VALUE-1)) {
            for (JobExecution jobExecution : jobOperator.getJobExecutions(jobInstance)) {
                StringBuilder sb = new StringBuilder();
                sb.append("<tr>");
                sb.append("<td>").append(jobExecution.getJobName()).append("</td>");
                sb.append("<td>").append(jobExecution.getExecutionId()).append("</td>");
                sb.append("<td>").append(jobExecution.getBatchStatus()).append("</td>");
                sb.append("<td>").append(jobExecution.getExitStatus()).append("</td>");
                sb.append("<td>").append(jobExecution.getStartTime()).append("</td>");
                sb.append("<td>").append(jobExecution.getEndTime()).append("</td>");
                pw.println(sb.toString());
            }
        }
    } catch (Exception ex) {

    }
    pw.println("</table>");
    pw.println("</table>");
}
 
开发者ID:osmanpub,项目名称:oracle-samples,代码行数:31,代码来源:PayrollJobSubmitterServlet.java

示例3: clearPersistence

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
private static void clearPersistence(final JobOperator jobOperator) {
    final PersistenceManagerService service = ServicesManager.find().service(PersistenceManagerService.class);
    for (final String name : jobOperator.getJobNames()) {
        for (final JobInstance id : jobOperator.getJobInstances(name, 0, Integer.MAX_VALUE)) {
            service.cleanUp(id.getInstanceId());
        }
    }
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:9,代码来源:JMXTest.java

示例4: contextInitialized

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
@Override
public void contextInitialized(final ServletContextEvent sce) {
    final JobOperator operator = BatchRuntime.getJobOperator();

    try { // initialize only once to ensure we can use in tests ids
        operator.getJobInstances("init", 0, 10);
    } catch (final NoSuchJobException nsje) {
        final Properties jobParameters = new Properties();
        jobParameters.setProperty("test", "jbatch");
        final long id = operator.start("init", jobParameters);
        Batches.waitForEnd(operator, id);
    }
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:14,代码来源:CreateSomeJobs.java


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