EMMA Coverage Report (generated Tue May 06 07:29:23 PDT 2008)
[all classes][org.springframework.batch.core]

COVERAGE SUMMARY FOR SOURCE FILE [JobInstance.java]

nameclass, %method, %block, %line, %
JobInstance.java100% (1/1)100% (5/5)96%  (53/55)97%  (8.8/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class JobInstance100% (1/1)100% (5/5)96%  (53/55)97%  (8.8/9)
getJobName (): String 100% (1/1)78%  (7/9)77%  (0.8/1)
JobInstance (Long, JobParameters, Job): void 100% (1/1)100% (18/18)100% (5/5)
getJob (): Job 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 ({@link JobInstance#getJob()})
30 * is not restartable.
31 * 
32 * @see Job
33 * @see JobParameters
34 * @see JobExecution
35 * 
36 * @author Lucas Ward
37 * @author Dave Syer
38 * @author Robert Kasanicky
39 * 
40 */
41public class JobInstance extends Entity {
42 
43        private JobParameters jobParameters;
44 
45        private Job job;
46 
47        public JobInstance(Long id, JobParameters jobParameters, Job job) {
48                super(id);
49                Assert.notNull(job);
50                this.jobParameters = jobParameters == null ? new JobParameters() : jobParameters;
51                this.job = job;
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 job == null ? null : job.getName();
66        }
67 
68        public String toString() {
69                return super.toString() + ", JobParameters=[" + jobParameters + "]" + ", Job=[" + job + "]";
70        }
71 
72        public Job getJob() {
73                return job;
74        }
75 
76}

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