Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RESOLVED - issue BATCH-743: ExportedJobLauncher should be able to sto…

…p running batches on an individual basis

Added some new methods to interface
  • Loading branch information...
commit b8258c77586db78f1a7971f5582d26ceb70c5dd7 1 parent ea0985f
dsyer authored
View
51 ...ain/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactory.java
@@ -4,21 +4,24 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
-public class ClassPathXmlApplicationContextFactory implements
- ApplicationContextFactory, ApplicationContextAware {
+public class ClassPathXmlApplicationContextFactory implements ApplicationContextFactory, ApplicationContextAware {
- private ApplicationContext parent;
+ private ConfigurableApplicationContext parent;
- private String path;
+ private Resource[] path;
/**
- * @param path
- * the resource path to the xml to load for the child context.
+ * Setter for the path to the xml to load to create an
+ * {@link ApplicationContext}. Can include wild cards as per the usual
+ * Spring resource resolution.
+ *
+ * @param path the resource path to the xml to load for the child context.
*/
- public void setPath(String path) {
+ public void setPath(Resource[] path) {
this.path = path;
}
@@ -27,11 +30,9 @@ public void setPath(String path) {
*
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/
- public void setApplicationContext(ApplicationContext applicationContext)
- throws BeansException {
- Assert.isInstanceOf(ConfigurableApplicationContext.class,
- applicationContext);
- parent = applicationContext;
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ Assert.isInstanceOf(ConfigurableApplicationContext.class, applicationContext);
+ parent = (ConfigurableApplicationContext) applicationContext;
}
/**
@@ -40,7 +41,29 @@ public void setApplicationContext(ApplicationContext applicationContext)
* @see ApplicationContextFactory#createApplicationContext()
*/
public ConfigurableApplicationContext createApplicationContext() {
- return new ClassPathXmlApplicationContext(new String[] { path }, parent);
+ if (path==null) {
+ return parent;
+ }
+ return new ResourceXmlApplicationContext(parent);
}
+ /**
+ * @author Dave Syer
+ *
+ */
+ private final class ResourceXmlApplicationContext extends AbstractXmlApplicationContext {
+ /**
+ * @param parent
+ */
+ private ResourceXmlApplicationContext(ApplicationContext parent) {
+ super(parent);
+ refresh();
+ }
+
+ protected Resource[] getConfigResources() {
+ return path;
+ }
+ }
+
+
}
View
20 spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExportedJobLauncher.java
@@ -58,6 +58,17 @@
void stop();
/**
+ * Stop running jobs with the supplied name.
+ */
+ void stop(String name);
+
+ /**
+ * Clear volatile memory of any jobs that are not running (and are therefore
+ * completed or failed).
+ */
+ void clear();
+
+ /**
* Enquire if any jobs launched here are still running.
*
* @return true if any jobs are running.
@@ -65,11 +76,10 @@
boolean isRunning();
/**
- * Query statistics of currently executing jobs.
+ * Query statistics of jobs.
*
- * @return properties representing last known state of currently executing
- * jobs
+ * @return properties representing last known state of jobs with this name
+ * (including those that may have finished)
*/
- public Properties getStatistics();
-
+ public Properties getStatistics(String name);
}
View
52 ...tch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java
@@ -15,6 +15,7 @@
*/
package org.springframework.batch.core.launch.support;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -33,9 +34,8 @@
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
-import org.springframework.context.ResourceLoaderAware;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.core.io.ResourceLoader;
+import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
/**
@@ -60,7 +60,7 @@
* @author Dave Syer
*
*/
-public class JobRegistryBackgroundJobRunner implements ResourceLoaderAware {
+public class JobRegistryBackgroundJobRunner {
/**
* System property key that switches the runner to "embedded" mode
@@ -73,8 +73,6 @@
private JobRegistry registry;
- private ResourceLoader resourceLoader;
-
private ApplicationContext parentContext = null;
final private String parentContextPath;
@@ -97,14 +95,6 @@ public void setRegistry(JobRegistry registry) {
this.registry = registry;
}
- /*
- * (non-Javadoc)
- * @see org.springframework.context.ResourceLoaderAware#setResourceLoader(org.springframework.core.io.ResourceLoader)
- */
- public void setResourceLoader(ResourceLoader resourceLoader) {
- this.resourceLoader = resourceLoader;
- }
-
/**
* Public getter for the startup errors encountered during parent context
* creation.
@@ -114,21 +104,33 @@ public void setResourceLoader(ResourceLoader resourceLoader) {
return errors;
}
- private void register(String[] paths) throws DuplicateJobException {
+ private void register(String[] paths) throws DuplicateJobException, IOException {
+
for (int i = 0; i < paths.length; i++) {
- String path = paths[i];
- logger.info("Registering Job definitions from " + path);
- ConfigurableListableBeanFactory beanFactory = new XmlBeanFactory(resourceLoader.getResource(path),
- parentContext.getAutowireCapableBeanFactory());
- String[] names = beanFactory.getBeanNamesForType(Job.class);
- for (int j = 0; j < names.length; j++) {
- ClassPathXmlApplicationContextFactory factory = new ClassPathXmlApplicationContextFactory();
- factory.setApplicationContext(parentContext);
- factory.setPath(path);
- logger.info("Registering Job definition: " + names[j]);
- registry.register(new ApplicationContextJobFactory(factory, names[j]));
+
+ Resource[] resources = parentContext.getResources(paths[i]);
+
+ for (int j = 0; j < resources.length; j++) {
+
+ Resource path = resources[j];
+ logger.info("Registering Job definitions from " + resources);
+
+ ConfigurableListableBeanFactory beanFactory = new XmlBeanFactory(path, parentContext
+ .getAutowireCapableBeanFactory());
+ String[] names = beanFactory.getBeanNamesForType(Job.class);
+
+ for (int k = 0; k < names.length; k++) {
+ ClassPathXmlApplicationContextFactory factory = new ClassPathXmlApplicationContextFactory();
+ factory.setApplicationContext(parentContext);
+ factory.setPath(new Resource[] { path });
+ logger.info("Registering Job definition: " + names[k]);
+ registry.register(new ApplicationContextJobFactory(factory, names[k]));
+ }
+
}
+
}
+
}
/**
View
71 ...ng-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncher.java
@@ -16,8 +16,10 @@
package org.springframework.batch.core.launch.support;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import java.util.Map.Entry;
import org.springframework.batch.core.Job;
@@ -41,6 +43,8 @@
*/
public class SimpleExportedJobLauncher implements ExportedJobLauncher, InitializingBean {
+ private static final String SEPARATOR = "|";
+
private JobLauncher launcher;
private JobLocator jobLocator;
@@ -52,8 +56,7 @@
/*
* (non-Javadoc)
*
- * @see
- * org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
+ * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
public void afterPropertiesSet() throws Exception {
Assert.notNull(launcher, "JobLauncher must be provided.");
@@ -87,16 +90,16 @@ public void setJobParametersFactory(JobParametersConverter jobParametersConverte
/*
* (non-Javadoc)
*
- * @see
- * org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
+ * @see org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
* #getStatistics()
*/
- public Properties getStatistics() {
+ public Properties getStatistics(String name) {
Properties result = new Properties();
int i = 0;
- for (String key : registry.keySet()) {
+ Set<String> keys = getKeyForName(name);
+ for (String key : keys) {
JobExecution execution = (JobExecution) registry.get(key);
- addStatistics(result, execution, "job" + i + ".");
+ addStatistics(result, execution, name + "." + i + ".");
i++;
}
return result;
@@ -119,8 +122,7 @@ private void addStatistics(Properties result, JobExecution execution, String pre
/*
* (non-Javadoc)
*
- * @see
- * org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
+ * @see org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
* #isRunning()
*/
public boolean isRunning() {
@@ -136,8 +138,7 @@ public boolean isRunning() {
/*
* (non-Javadoc)
*
- * @see
- * org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
+ * @see org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
* #run(java.lang.String)
*/
public String run(String name) {
@@ -147,8 +148,7 @@ public String run(String name) {
/*
* (non-Javadoc)
*
- * @see
- * org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
+ * @see org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
* #run(java.lang.String, java.lang.String)
*/
public String run(String name, String params) {
@@ -173,7 +173,7 @@ public String run(String name, String params) {
catch (JobExecutionException e) {
return e.getClass().getName() + ": " + e.getMessage();
}
- registry.put(name + params, execution);
+ registry.put(name + SEPARATOR + params, execution);
return execution.toString();
@@ -182,8 +182,7 @@ public String run(String name, String params) {
/*
* (non-Javadoc)
*
- * @see
- * org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
+ * @see org.springframework.batch.execution.bootstrap.support.ExportedJobLauncher
* #stop()
*/
public void stop() {
@@ -191,7 +190,45 @@ public void stop() {
JobExecution execution = (JobExecution) registry.get(key);
execution.stop();
}
- registry.clear();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.springframework.batch.core.launch.support.ExportedJobLauncher#stop(java.lang.String)
+ */
+ public void stop(String name) {
+ Set<String> keys = getKeyForName(name);
+ for (String key : keys) {
+ JobExecution execution = (JobExecution) registry.get(key);
+ execution.stop();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.springframework.batch.core.launch.support.ExportedJobLauncher#clear()
+ */
+ public void clear() {
+ for (String key : registry.keySet()) {
+ JobExecution execution = (JobExecution) registry.get(key);
+ if (!execution.isRunning()) {
+ registry.remove(key);
+ }
+ }
+ }
+
+ /**
+ * @param key
+ * @return
+ */
+ private Set<String> getKeyForName(String name) {
+ Set<String> result = new HashSet<String>();
+ for (String key : registry.keySet()) {
+ if (key.startsWith(name + SEPARATOR)) {
+ result.add(key);
+ }
+ }
+ return result;
}
}
View
6 ...ava/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactoryTests.java
@@ -18,6 +18,8 @@
import junit.framework.TestCase;
import org.springframework.batch.core.Job;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
import org.springframework.util.ClassUtils;
/**
@@ -29,12 +31,12 @@
private ClassPathXmlApplicationContextFactory factory = new ClassPathXmlApplicationContextFactory();
public void testCreateJob() {
- factory.setPath(ClassUtils.addResourcePathToPackagePath(getClass(), "trivial-context.xml"));
+ factory.setPath(new Resource[] {new ClassPathResource(ClassUtils.addResourcePathToPackagePath(getClass(), "trivial-context.xml"))});
assertNotNull(factory.createApplicationContext());
}
public void testGetJobName() {
- factory.setPath(ClassUtils.addResourcePathToPackagePath(getClass(), "trivial-context.xml"));
+ factory.setPath(new Resource[] {new ClassPathResource(ClassUtils.addResourcePathToPackagePath(getClass(), "trivial-context.xml"))});
assertEquals("test-job", factory.createApplicationContext().getBeanNamesForType(Job.class)[0]);
}
View
88 ...tch-core/src/test/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncherTests.java
@@ -15,12 +15,20 @@
*/
package org.springframework.batch.core.launch.support;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.Properties;
-import junit.framework.TestCase;
-
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
@@ -39,16 +47,18 @@
* @author Dave Syer
*
*/
-public class SimpleExportedJobLauncherTests extends TestCase {
+public class SimpleExportedJobLauncherTests {
private SimpleExportedJobLauncher launcher = new SimpleExportedJobLauncher();
- private MapJobRegistry jobLocator;
+ private MapJobRegistry jobLocator = new MapJobRegistry();
- private List<JobParameters> list = new ArrayList<JobParameters>();
+ private List<JobParameters> parameters = new ArrayList<JobParameters>();
- protected void setUp() throws Exception {
- super.setUp();
+ private List<JobExecution> executions = new ArrayList<JobExecution>();
+
+ @Before
+ public void setUp() throws Exception {
launcher.setLauncher(new JobLauncher() {
public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionAlreadyRunningException {
JobExecution result = new JobExecution(null);
@@ -58,11 +68,11 @@ public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutio
put("foo", "bar");
}
});
- list.add(jobParameters);
+ parameters.add(jobParameters);
+ executions.add(result);
return result;
}
});
- jobLocator = new MapJobRegistry();
launcher.setJobLocator(jobLocator);
}
@@ -73,6 +83,7 @@ public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutio
*
* @throws Exception
*/
+ @Test
public void testAfterPropertiesSet() throws Exception {
launcher = new SimpleExportedJobLauncher();
try {
@@ -93,6 +104,7 @@ public void testAfterPropertiesSet() throws Exception {
*
* @throws Exception
*/
+ @Test
public void testAfterPropertiesSetWithLauncher() throws Exception {
launcher = new SimpleExportedJobLauncher();
launcher.setLauncher(new JobLauncher() {
@@ -110,28 +122,18 @@ public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutio
}
}
- /**
- * Test method for
- * {@link org.springframework.batch.core.launch.support.SimpleExportedJobLauncher#getStatistics()}
- * .
- */
+ @Test
public void testGetStatistics() {
- Properties props = launcher.getStatistics();
+ Properties props = launcher.getStatistics("foo");
assertNotNull(props);
assertEquals(0, props.entrySet().size());
}
- /**
- * Test method for
- * {@link org.springframework.batch.core.launch.support.SimpleExportedJobLauncher#getStatistics()}
- * .
- *
- * @throws Exception
- */
+ @Test
public void testGetStatisticsWithContent() throws Exception {
jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
launcher.run("foo");
- Properties props = launcher.getStatistics();
+ Properties props = launcher.getStatistics("foo");
assertNotNull(props);
assertEquals(1, props.entrySet().size());
}
@@ -143,6 +145,7 @@ public void testGetStatisticsWithContent() throws Exception {
*
* @throws Exception
*/
+ @Test
public void testIsRunning() throws Exception {
jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
launcher.run("foo");
@@ -156,6 +159,7 @@ public void testIsRunning() throws Exception {
*
* @throws Exception
*/
+ @Test
public void testAlreadyRunning() throws Exception {
jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
launcher.setLauncher(new JobLauncher() {
@@ -173,6 +177,7 @@ public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutio
* {@link org.springframework.batch.core.launch.support.SimpleExportedJobLauncher#run(java.lang.String)}
* .
*/
+ @Test
public void testRunNonExistentJob() {
String value = launcher.run("foo");
assertTrue("Return value was not an exception: " + value, contains(value, "NoSuchJobException"));
@@ -185,6 +190,7 @@ public void testRunNonExistentJob() {
*
* @throws Exception
*/
+ @Test
public void testRunJobWithParameters() throws Exception {
jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
String value = launcher.run("foo", "bar=spam,bucket=crap");
@@ -199,6 +205,7 @@ public void testRunJobWithParameters() throws Exception {
*
* @throws Exception
*/
+ @Test
public void testRunJobWithParametersAndFactory() throws Exception {
jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
launcher.setJobParametersFactory(new JobParametersConverter() {
@@ -211,8 +218,8 @@ public Properties getProperties(JobParameters params) {
}
});
launcher.run("foo", "bar=spam,bucket=crap");
- assertEquals(1, list.size());
- assertEquals("spam", list.get(0).getString("foo"));
+ assertEquals(1, parameters.size());
+ assertEquals("spam", parameters.get(0).getString("foo"));
}
/**
@@ -222,12 +229,41 @@ public Properties getProperties(JobParameters params) {
*
* @throws Exception
*/
+ @Test
public void testStop() throws Exception {
jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
launcher.run("foo");
assertTrue(launcher.isRunning());
launcher.stop();
- assertFalse(launcher.isRunning());
+ assertEquals(BatchStatus.STOPPING, executions.get(0).getStatus());
+ assertTrue(launcher.isRunning());
+ }
+
+ /**
+ * Test method for
+ * {@link org.springframework.batch.core.launch.support.SimpleExportedJobLauncher#stop()}
+ * .
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testStopWithName() throws Exception {
+ jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
+ launcher.run("foo");
+ assertTrue(launcher.isRunning());
+ launcher.stop("foo");
+ assertEquals(BatchStatus.STOPPING, executions.get(0).getStatus());
+ assertTrue(launcher.isRunning());
+ }
+
+ @Test
+ public void testClear() throws Exception {
+ jobLocator.register(new ReferenceJobFactory(new JobSupport("foo")));
+ launcher.run("foo");
+ // mark it as actually ended
+ executions.get(0).setEndTime(new Date());
+ launcher.clear();
+ assertFalse(launcher.isRunning());
}
private boolean contains(String str, String searchStr) {
View
116 spring-batch-samples/.fbprefs
@@ -0,0 +1,116 @@
+#FindBugs User Preferences
+#Wed Jul 23 12:11:15 BST 2008
+detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
+detectorBadAppletConstructor=BadAppletConstructor|false
+detectorBadResultSetAccess=BadResultSetAccess|true
+detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true
+detectorBadUseOfReturnValue=BadUseOfReturnValue|true
+detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
+detectorBooleanReturnNull=BooleanReturnNull|true
+detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
+detectorCheckTypeQualifiers=CheckTypeQualifiers|true
+detectorCloneIdiom=CloneIdiom|true
+detectorComparatorIdiom=ComparatorIdiom|true
+detectorConfusedInheritance=ConfusedInheritance|true
+detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
+detectorCrossSiteScripting=CrossSiteScripting|true
+detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true
+detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true
+detectorDontUseEnum=DontUseEnum|true
+detectorDroppedException=DroppedException|true
+detectorDumbMethodInvocations=DumbMethodInvocations|true
+detectorDumbMethods=DumbMethods|true
+detectorDuplicateBranches=DuplicateBranches|true
+detectorEmptyZipFileEntry=EmptyZipFileEntry|true
+detectorFinalizerNullsFields=FinalizerNullsFields|true
+detectorFindBadCast2=FindBadCast2|true
+detectorFindBadForLoop=FindBadForLoop|true
+detectorFindCircularDependencies=FindCircularDependencies|false
+detectorFindDeadLocalStores=FindDeadLocalStores|true
+detectorFindDoubleCheck=FindDoubleCheck|true
+detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true
+detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true
+detectorFindFinalizeInvocations=FindFinalizeInvocations|true
+detectorFindFloatEquality=FindFloatEquality|true
+detectorFindHEmismatch=FindHEmismatch|true
+detectorFindInconsistentSync2=FindInconsistentSync2|true
+detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true
+detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true
+detectorFindMaskedFields=FindMaskedFields|true
+detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true
+detectorFindNakedNotify=FindNakedNotify|true
+detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true
+detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true
+detectorFindNonShortCircuit=FindNonShortCircuit|true
+detectorFindNullDeref=FindNullDeref|true
+detectorFindOpenStream=FindOpenStream|true
+detectorFindPuzzlers=FindPuzzlers|true
+detectorFindRefComparison=FindRefComparison|true
+detectorFindReturnRef=FindReturnRef|true
+detectorFindRunInvocations=FindRunInvocations|true
+detectorFindSelfComparison=FindSelfComparison|true
+detectorFindSelfComparison2=FindSelfComparison2|true
+detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true
+detectorFindSpinLoop=FindSpinLoop|true
+detectorFindSqlInjection=FindSqlInjection|true
+detectorFindTwoLockWait=FindTwoLockWait|true
+detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true
+detectorFindUnconditionalWait=FindUnconditionalWait|true
+detectorFindUninitializedGet=FindUninitializedGet|true
+detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true
+detectorFindUnreleasedLock=FindUnreleasedLock|true
+detectorFindUnsyncGet=FindUnsyncGet|true
+detectorFindUselessControlFlow=FindUselessControlFlow|true
+detectorHugeSharedStringConstants=HugeSharedStringConstants|true
+detectorIDivResultCastToDouble=IDivResultCastToDouble|true
+detectorIncompatMask=IncompatMask|true
+detectorInefficientMemberAccess=InefficientMemberAccess|false
+detectorInefficientToArray=InefficientToArray|true
+detectorInfiniteLoop=InfiniteLoop|true
+detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
+detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|false
+detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
+detectorInitializationChain=InitializationChain|true
+detectorInstantiateStaticClass=InstantiateStaticClass|true
+detectorInvalidJUnitTest=InvalidJUnitTest|true
+detectorIteratorIdioms=IteratorIdioms|true
+detectorLazyInit=LazyInit|true
+detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true
+detectorMethodReturnCheck=MethodReturnCheck|true
+detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true
+detectorMutableLock=MutableLock|true
+detectorMutableStaticFields=MutableStaticFields|true
+detectorNaming=Naming|true
+detectorNumberConstructor=NumberConstructor|true
+detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
+detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
+detectorPublicSemaphores=PublicSemaphores|false
+detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
+detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true
+detectorRedundantInterfaces=RedundantInterfaces|true
+detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true
+detectorSerializableIdiom=SerializableIdiom|true
+detectorStartInConstructor=StartInConstructor|true
+detectorStaticCalendarDetector=StaticCalendarDetector|true
+detectorStringConcatenation=StringConcatenation|true
+detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true
+detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true
+detectorSwitchFallthrough=SwitchFallthrough|true
+detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true
+detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true
+detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true
+detectorURLProblems=URLProblems|true
+detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true
+detectorUnnecessaryMath=UnnecessaryMath|true
+detectorUnreadFields=UnreadFields|true
+detectorUseObjectEquals=UseObjectEquals|false
+detectorUselessSubclassMethod=UselessSubclassMethod|false
+detectorVarArgsProblems=VarArgsProblems|true
+detectorVolatileUsage=VolatileUsage|true
+detectorWaitInLoop=WaitInLoop|true
+detectorWrongMapIterator=WrongMapIterator|true
+detectorXMLFactoryBypass=XMLFactoryBypass|true
+detector_threshold=2
+effort=default
+filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false
+filter_settings_neg=|
View
2  spring-batch-samples/.settings/jmxLauncher.launch
@@ -9,7 +9,7 @@
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-core&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-execution&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-infrastructure&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-integration&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-samples&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
+<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-core&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-execution&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-infrastructure&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-integration&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;spring-batch-samples&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.springframework.batch.core.launch.support.JobRegistryBackgroundJobRunner"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="adhoc-job-launcher-context.xml jobs/adhocLoopJob.xml jobs/footballJob.xml"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="spring-batch-samples"/>
View
1  spring-batch-samples/src/test/java/org/springframework/batch/sample/launch/RemoteLauncherTests.java
@@ -74,6 +74,7 @@ public void testLaunchAndStopRealJob() throws Exception {
Thread.sleep(500);
assertTrue(launcher.isRunning());
launcher.stop();
+ Thread.sleep(500);
assertFalse(launcher.isRunning());
}
Please sign in to comment.
Something went wrong with that request. Please try again.