diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactory.java index e56897824..cd21319d1 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactory.java @@ -4,21 +4,24 @@ import org.springframework.beans.BeansException; 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 class ClassPathXmlApplicationContextFactory implements * * @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 class ClassPathXmlApplicationContextFactory implements * @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; + } + } + + } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExportedJobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExportedJobLauncher.java index be61fa125..3c1463ba0 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExportedJobLauncher.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExportedJobLauncher.java @@ -57,6 +57,17 @@ public interface ExportedJobLauncher { */ 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. * @@ -65,11 +76,10 @@ public interface ExportedJobLauncher { 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); } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java index 038b2a1a3..a59b9c7f2 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java +++ b/spring-batch-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.AutowireCapableBeanFactory; 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 @@ import org.springframework.util.Assert; * @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 @@ public class JobRegistryBackgroundJobRunner implements ResourceLoaderAware { private JobRegistry registry; - private ResourceLoader resourceLoader; - private ApplicationContext parentContext = null; final private String parentContextPath; @@ -97,14 +95,6 @@ public class JobRegistryBackgroundJobRunner implements ResourceLoaderAware { 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 class JobRegistryBackgroundJobRunner implements ResourceLoaderAware { 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])); + } + } + } + } /** diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncher.java index f58f189aa..654233865 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncher.java +++ b/spring-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 @@ import org.springframework.util.Assert; */ public class SimpleExportedJobLauncher implements ExportedJobLauncher, InitializingBean { + private static final String SEPARATOR = "|"; + private JobLauncher launcher; private JobLocator jobLocator; @@ -52,8 +56,7 @@ public class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ /* * (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 class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ /* * (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 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 @@ public class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ /* * (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 class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ /* * (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 class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ /* * (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 class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ 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 class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ /* * (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 class SimpleExportedJobLauncher implements ExportedJobLauncher, Initializ 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 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 getKeyForName(String name) { + Set result = new HashSet(); + for (String key : registry.keySet()) { + if (key.startsWith(name + SEPARATOR)) { + result.add(key); + } + } + return result; } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactoryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactoryTests.java index a69375672..568951538 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactoryTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextFactoryTests.java @@ -18,6 +18,8 @@ package org.springframework.batch.core.configuration.support; 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 @@ public class ClassPathXmlApplicationContextFactoryTests extends TestCase { 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]); } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncherTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncherTests.java index 929349628..5316cf804 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/launch/support/SimpleExportedJobLauncherTests.java +++ b/spring-batch-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 @@ import org.springframework.batch.item.ExecutionContext; * @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 list = new ArrayList(); + private List parameters = new ArrayList(); - protected void setUp() throws Exception { - super.setUp(); + private List executions = new ArrayList(); + + @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 class SimpleExportedJobLauncherTests extends TestCase { 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 class SimpleExportedJobLauncherTests extends TestCase { * * @throws Exception */ + @Test public void testAfterPropertiesSet() throws Exception { launcher = new SimpleExportedJobLauncher(); try { @@ -93,6 +104,7 @@ public class SimpleExportedJobLauncherTests extends TestCase { * * @throws Exception */ + @Test public void testAfterPropertiesSetWithLauncher() throws Exception { launcher = new SimpleExportedJobLauncher(); launcher.setLauncher(new JobLauncher() { @@ -110,28 +122,18 @@ public class SimpleExportedJobLauncherTests extends TestCase { } } - /** - * 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 class SimpleExportedJobLauncherTests extends TestCase { * * @throws Exception */ + @Test public void testIsRunning() throws Exception { jobLocator.register(new ReferenceJobFactory(new JobSupport("foo"))); launcher.run("foo"); @@ -156,6 +159,7 @@ public class SimpleExportedJobLauncherTests extends TestCase { * * @throws Exception */ + @Test public void testAlreadyRunning() throws Exception { jobLocator.register(new ReferenceJobFactory(new JobSupport("foo"))); launcher.setLauncher(new JobLauncher() { @@ -173,6 +177,7 @@ public class SimpleExportedJobLauncherTests extends TestCase { * {@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 class SimpleExportedJobLauncherTests extends TestCase { * * @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 class SimpleExportedJobLauncherTests extends TestCase { * * @throws Exception */ + @Test public void testRunJobWithParametersAndFactory() throws Exception { jobLocator.register(new ReferenceJobFactory(new JobSupport("foo"))); launcher.setJobParametersFactory(new JobParametersConverter() { @@ -211,8 +218,8 @@ public class SimpleExportedJobLauncherTests extends TestCase { } }); 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 class SimpleExportedJobLauncherTests extends TestCase { * * @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) { diff --git a/spring-batch-samples/.fbprefs b/spring-batch-samples/.fbprefs new file mode 100644 index 000000000..d498aadba --- /dev/null +++ b/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=| diff --git a/spring-batch-samples/.settings/jmxLauncher.launch b/spring-batch-samples/.settings/jmxLauncher.launch index 6016abc33..a60b6c30b 100644 --- a/spring-batch-samples/.settings/jmxLauncher.launch +++ b/spring-batch-samples/.settings/jmxLauncher.launch @@ -9,7 +9,7 @@ - + diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/launch/RemoteLauncherTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/launch/RemoteLauncherTests.java index 3b47c79ab..5d6d1c514 100644 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/launch/RemoteLauncherTests.java +++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/launch/RemoteLauncherTests.java @@ -74,6 +74,7 @@ public class RemoteLauncherTests { Thread.sleep(500); assertTrue(launcher.isRunning()); launcher.stop(); + Thread.sleep(500); assertFalse(launcher.isRunning()); }