Package javax.batch.runtime

Examples of javax.batch.runtime.JobInstance


        return result;
    }

    @Override
    public JobInstance getJobInstance(final long jobInstanceId) {
        JobInstance result = super.getJobInstance(jobInstanceId);
        if (result != null) {
            return result;
        }

        final String select = sqls.getProperty(SELECT_JOB_INSTANCE);
View Full Code Here


        return result;
    }

    @Override
    public JobInstance getJobInstance(final long jobInstanceId) {
        JobInstance result = super.getJobInstance(jobInstanceId);
        if (result != null) {
            return result;
        }

        final DBObject one = db.getCollection(TableColumns.JOB_INSTANCE).findOne(
View Full Code Here

    public List<JobInstance> getJobInstances(final String jobName, final int start, final int count) throws NoSuchJobException, JobSecurityException {
        final List<JobInstance> result = new ArrayList<JobInstance>();
        int pos = 0;
        final List<JobInstance> instances = repository.getJobInstances(jobName);
        for (int i = instances.size() - 1; i >= 0; i--) {
            final JobInstance e = instances.get(i);
            if (pos >= start) {
                if (result.size() < count) {
                    result.add(e);
                } else {
                    break;
View Full Code Here

        return result;
    }

    @Override
    public JobInstance getJobInstance(final long jobInstanceId) {
        JobInstance result = super.getJobInstance(jobInstanceId);
        if (result != null) {
            return result;
        }

        final String select = sqls.getProperty(SELECT_JOB_INSTANCE);
View Full Code Here

    public List<JobInstance> getJobInstances(final String jobName, final int start, final int count) throws NoSuchJobException, JobSecurityException {
        final LinkedList<JobInstance> result = new LinkedList<JobInstance>();
        int pos = 0;
        final List<JobInstance> instances = repository.getJobInstances(jobName);
        for (int i = instances.size() - 1; i >= 0; i--) {
            final JobInstance e = instances.get(i);
            if (pos >= start) {
                if (result.size() < count) {
                    result.add(e);
                } else {
                    break;
View Full Code Here

        extraProps.put("listBatchJobExecutions", jobExecutions);
        if (executionId != null) {
            JobOperator jobOperator = BatchRuntime.getJobOperator();
            JobExecution je = jobOperator.getJobExecution(Long.valueOf(executionId));
            if (instanceId != null) {
                JobInstance ji = jobOperator.getJobInstance(Long.valueOf(executionId));
                if (ji.getInstanceId() != Long.valueOf(instanceId)) {
                    throw new RuntimeException("executionid " + executionId
                    + " is not associated with the specified instanceid (" + instanceId + ")"
                    + "; did you mean " + ji.getInstanceId() + " ?");
                }
            }
            jobExecutions.add(handleJob(je, columnFormatter));
        } else if (instanceId != null) {
            for (JobExecution je : getJobExecutionForInstance(Long.valueOf(instanceId))) {
View Full Code Here

    }

    private static List<JobExecution> getJobExecutionForInstance(long instId)
            throws JobSecurityException, NoSuchJobException, NoSuchJobInstanceException, NoSuchJobExecutionException {
        JobOperator jobOperator = BatchRuntime.getJobOperator();
        JobInstance jobInstance = null;
        for (String jn : jobOperator.getJobNames()) {
            List<JobInstance> exe = jobOperator.getJobInstances(jn, 0, Integer.MAX_VALUE - 1);
            if (exe != null) {
                for (JobInstance ji : exe) {
                    if (ji.getInstanceId() == instId) {
View Full Code Here

    public List<JobInstance> getJobInstances(String jobName, int start, int count) throws NoSuchJobException, JobSecurityException {
        LinkedList<JobInstance> result = new LinkedList<JobInstance>();
        int pos = 0;
        List<JobInstance> instances = repository.getJobInstances();
        for (int i = instances.size() - 1; i >= 0; i--) {
            JobInstance e = instances.get(i);
            if (e.getJobName().equals(jobName)) {
                if (pos >= start) {
                    if (result.size() < count) {
                        result.add(e);
                    } else {
                        break;
View Full Code Here

    }

    private static List<JobExecution> getJobExecutionForInstance(long instId)
            throws JobSecurityException {
        JobOperator jobOperator = BatchRuntime.getJobOperator();
        JobInstance jobInstance = null;
        for (String jn : jobOperator.getJobNames()) {
            List<JobInstance> exe = jobOperator.getJobInstances(jn, 0, Integer.MAX_VALUE - 1);
            if (exe != null) {
                for (JobInstance ji : exe) {
                    if (ji.getInstanceId() == instId) {
View Full Code Here

    @Override
    public void removeJob(final String jobId) {
        jobs.remove(jobId);
        synchronized (jobInstances) {
            for (Iterator<Map.Entry<Long, JobInstance>> it = jobInstances.entrySet().iterator(); it.hasNext();) {
                final JobInstance ji = it.next().getValue();
                if (ji.getJobName().equals(jobId)) {
                    it.remove();
                }
            }
        }
        for (Iterator<Map.Entry<Long, JobExecution>> it = jobExecutions.entrySet().iterator(); it.hasNext();) {
View Full Code Here

TOP

Related Classes of javax.batch.runtime.JobInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.