EMMA Coverage Report (generated Fri Aug 21 15:59:46 BST 2009)
[all classes][org.springframework.batch.core]

COVERAGE SUMMARY FOR SOURCE FILE [JobInstance.java]

nameclass, %method, %block, %line, %
JobInstance.java100% (1/1)100% (4/4)100% (46/46)100% (8/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class JobInstance100% (1/1)100% (4/4)100% (46/46)100% (8/8)
JobInstance (Long, JobParameters, String): void 100% (1/1)100% (18/18)100% (5/5)
getJobName (): String 100% (1/1)100% (3/3)100% (1/1)
getJobParameters (): JobParameters 100% (1/1)100% (3/3)100% (1/1)
toString (): String 100% (1/1)100% (22/22)100% (1/1)

1/*
2 * Copyright 2006-2007 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17package org.springframework.batch.core;
18 
19import org.springframework.util.Assert;
20 
21/**
22 * Batch domain object representing a uniquely identifiable job run - it's
23 * identity is given by the pair {@link Job} and {@link JobParameters}.
24 * JobInstance can be restarted multiple times in case of execution failure and
25 * it's lifecycle ends with first successful execution.
26 * 
27 * Trying to execute an existing JobIntance that has already completed
28 * successfully will result in error. Error will be raised also for an attempt
29 * to restart a failed JobInstance if the Job is not restartable.
30 * 
31 * @see Job
32 * @see JobParameters
33 * @see JobExecution
34 * 
35 * @author Lucas Ward
36 * @author Dave Syer
37 * @author Robert Kasanicky
38 * 
39 */
40public class JobInstance extends Entity {
41 
42        private final JobParameters jobParameters;
43 
44        private final String jobName;
45 
46        public JobInstance(Long id, JobParameters jobParameters, String jobName) {
47                super(id);
48                Assert.hasLength(jobName);
49                // Assert.hasLength(job.getName());
50                this.jobParameters = jobParameters == null ? new JobParameters() : jobParameters;
51                this.jobName = jobName;
52        }
53 
54        /**
55         * @return {@link JobParameters}
56         */
57        public JobParameters getJobParameters() {
58                return jobParameters;
59        }
60 
61        /**
62         * @return the job name. (Equivalent to getJob().getName())
63         */
64        public String getJobName() {
65                return jobName;
66        }
67 
68        public String toString() {
69                return super.toString() + ", JobParameters=[" + jobParameters + "]" + ", Job=[" + jobName + "]";
70        }
71 
72}

[all classes][org.springframework.batch.core]
EMMA 2.0.5312 (C) Vladimir Roubtsov