Upgraded dependency versions and minor polish
This commit is contained in:
@@ -29,6 +29,7 @@ import org.springframework.core.io.Resource;
|
||||
*
|
||||
* @deprecated use {@link GenericApplicationContextFactory} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class ClassPathXmlApplicationContextFactory extends GenericApplicationContextFactory {
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ package org.springframework.batch.core.configuration.support;
|
||||
*
|
||||
* @deprecated in version 2.1, please us {@link AutomaticJobRegistrar} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class ClassPathXmlJobRegistry {
|
||||
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ public class SimpleFlowFactoryBean implements FactoryBean<SimpleFlow>, Initializ
|
||||
* @param state The state that will be used to create the StepState
|
||||
* @param oldName The name to be replaced
|
||||
* @param stateName The name for the new State
|
||||
* @return
|
||||
* @return a state for the requested data
|
||||
*/
|
||||
protected State createNewStepState(State state, String oldName,
|
||||
String stateName) {
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
*/
|
||||
package org.springframework.batch.core.explore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.launch.NoSuchJobException;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Entry point for browsing executions of running or historical jobs and steps.
|
||||
* Since the data may be re-hydrated from persistent storage, it may not contain
|
||||
@@ -116,7 +116,7 @@ public interface JobExplorer {
|
||||
* @param jobName
|
||||
* @param start
|
||||
* @param count
|
||||
* @return
|
||||
* @return a list of {@link JobInstance} for the job name requested
|
||||
*/
|
||||
List<JobInstance> findJobInstancesByJobName(String jobName, int start, int count);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ public class JobFlowExecutor implements FlowExecutor {
|
||||
|
||||
/**
|
||||
* @param status
|
||||
* @return
|
||||
* @return A {@link BatchStatus} appropriate for the {@link FlowExecutionStatus} provided
|
||||
*/
|
||||
protected BatchStatus findBatchStatus(FlowExecutionStatus status) {
|
||||
for (BatchStatus batchStatus : BatchStatus.values()) {
|
||||
|
||||
@@ -71,6 +71,7 @@ public class StepState extends AbstractState implements StepLocator, StepHolder
|
||||
* @deprecated in favor of using {@link StepLocator#getStep(String)}.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Step getStep() {
|
||||
return step;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
|
||||
|
||||
/**
|
||||
* @param executionId
|
||||
* @return
|
||||
* @return job parameters for the requested execution id
|
||||
*/
|
||||
protected JobParameters getJobParameters(Long executionId) {
|
||||
final Map<String, JobParameter> map = new HashMap<String, JobParameter>();
|
||||
|
||||
@@ -104,7 +104,7 @@ public interface JobInstanceDao {
|
||||
* @param jobName
|
||||
* @param start
|
||||
* @param count
|
||||
* @return
|
||||
* @return a list of {@link JobInstance} for the job name requested.
|
||||
*/
|
||||
List<JobInstance> findJobInstancesByName(String jobName, int start, int count);
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean<Jo
|
||||
* @throws Exception if the repository could not be created
|
||||
* @deprecated use {@link #getObject()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public JobRepository getJobRepository() throws Exception {
|
||||
return getObject();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,13 @@
|
||||
|
||||
package org.springframework.batch.core.repository.support;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.sql.Types;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.batch.core.repository.ExecutionContextSerializer;
|
||||
import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao;
|
||||
import org.springframework.batch.core.repository.dao.ExecutionContextDao;
|
||||
@@ -36,15 +41,11 @@ import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.support.lob.DefaultLobHandler;
|
||||
import org.springframework.jdbc.support.lob.LobHandler;
|
||||
import org.springframework.jdbc.support.lob.OracleLobHandler;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.sql.Types;
|
||||
|
||||
import static org.springframework.batch.support.DatabaseType.SYBASE;
|
||||
|
||||
/**
|
||||
@@ -184,7 +185,7 @@ public class JobRepositoryFactoryBean extends AbstractJobRepositoryFactoryBean i
|
||||
}
|
||||
|
||||
if (lobHandler == null && databaseType.equalsIgnoreCase(DatabaseType.ORACLE.toString())) {
|
||||
lobHandler = new OracleLobHandler();
|
||||
lobHandler = new DefaultLobHandler();
|
||||
}
|
||||
|
||||
if(serializer == null) {
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
*/
|
||||
package org.springframework.batch.core.step.builder;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.batch.core.ChunkListener;
|
||||
import org.springframework.batch.core.ItemProcessListener;
|
||||
import org.springframework.batch.core.ItemReadListener;
|
||||
@@ -47,12 +53,6 @@ import org.springframework.batch.repeat.support.RepeatTemplate;
|
||||
import org.springframework.batch.support.ReflectionUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Step builder for simple item processing (chunk oriented) steps. Items are read and cached in chunks, and then
|
||||
* processed (transformed) and written (optionally either the processor or the writer can be omitted) all in the same
|
||||
@@ -111,8 +111,7 @@ public class SimpleStepBuilder<I, O> extends AbstractTaskletStepBuilder<SimpleSt
|
||||
}
|
||||
|
||||
public FaultTolerantStepBuilder<I, O> faultTolerant() {
|
||||
FaultTolerantStepBuilder<I, O> builder = new FaultTolerantStepBuilder<I, O>(this);
|
||||
return builder;
|
||||
return new FaultTolerantStepBuilder<I, O>(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,6 +247,7 @@ public class SimpleStepBuilder<I, O> extends AbstractTaskletStepBuilder<SimpleSt
|
||||
* @param listener the object that has a method configured with listener annotation
|
||||
* @return this for fluent chaining
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public SimpleStepBuilder listener(Object listener) {
|
||||
super.listener(listener);
|
||||
|
||||
@@ -15,23 +15,16 @@
|
||||
*/
|
||||
package org.springframework.batch.core.repository.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.Types;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.repository.ExecutionContextSerializer;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
@@ -45,11 +38,17 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
|
||||
import org.springframework.jdbc.support.lob.DefaultLobHandler;
|
||||
import org.springframework.jdbc.support.lob.LobHandler;
|
||||
import org.springframework.jdbc.support.lob.OracleLobHandler;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* @author Lucas Ward
|
||||
* @author Will Schipp
|
||||
@@ -115,7 +114,7 @@ public class JobRepositoryFactoryBeanTests {
|
||||
|
||||
factory.afterPropertiesSet();
|
||||
LobHandler lobHandler = (LobHandler) ReflectionTestUtils.getField(factory, "lobHandler");
|
||||
assertTrue(lobHandler instanceof OracleLobHandler);
|
||||
assertTrue(lobHandler instanceof DefaultLobHandler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,27 @@
|
||||
*/
|
||||
package org.springframework.batch.core.step.builder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.batch.core.*;
|
||||
import org.springframework.batch.core.annotation.*;
|
||||
|
||||
import org.springframework.batch.core.BatchStatus;
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepContribution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.StepExecutionListener;
|
||||
import org.springframework.batch.core.annotation.AfterChunk;
|
||||
import org.springframework.batch.core.annotation.AfterProcess;
|
||||
import org.springframework.batch.core.annotation.AfterRead;
|
||||
import org.springframework.batch.core.annotation.AfterStep;
|
||||
import org.springframework.batch.core.annotation.AfterWrite;
|
||||
import org.springframework.batch.core.annotation.BeforeChunk;
|
||||
import org.springframework.batch.core.annotation.BeforeProcess;
|
||||
import org.springframework.batch.core.annotation.BeforeRead;
|
||||
import org.springframework.batch.core.annotation.BeforeStep;
|
||||
import org.springframework.batch.core.annotation.BeforeWrite;
|
||||
import org.springframework.batch.core.configuration.xml.DummyItemWriter;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
|
||||
@@ -30,9 +48,6 @@ import org.springframework.batch.repeat.RepeatStatus;
|
||||
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -63,7 +78,7 @@ public class StepBuilderTests {
|
||||
|
||||
@Test
|
||||
public void testListeners() throws Exception {
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution("step");
|
||||
jobRepository.add(execution);
|
||||
PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
|
||||
@@ -89,7 +104,7 @@ public class StepBuilderTests {
|
||||
|
||||
@Test
|
||||
public void testItemListeners() throws Exception {
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution("step");
|
||||
jobRepository.add(execution);
|
||||
PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
|
||||
|
||||
Reference in New Issue
Block a user