Commit Graph

1857 Commits

Author SHA1 Message Date
Michael Minella
92e551e05d Add ability to override JSR-352 baseContext.xml
While existing functionality provided the ability to override the
components provided in the baseContext.xml (as required for JSR-352
functionality) at a job by job level, this commit allows a user to
specify a base context for all of the JSR-352 based jobs within a JVM.
To set the location of the custom base context, a JVM property
JSR-352-BASE-CONTEXT should be set.

BATCH-2290
2014-12-30 16:16:02 -06:00
Michael Minella
c10469367f Fixed manual wiring of JsrJobOperator
While the JSR-352 provides only one way to access the JobOperator
(BatchRuntime.getJobOperator()), it is useful for testing and embedding
to be able to wire your own JsrJobOperator instance.  This commit
addresses previous issues with using the constructor that provided that
functionality.

Note: This is a breaking change in that there is a new parameter on the
non-default constructor (adding a PlatformTransactionManager reference).
Users using the JsrJobOperator through the BatchRuntime as previously
mentioned should not be impacted.  Since this is the *only* method
perscribed by the JSR to consume that class, it is not expected to have
a large impact.

This fix partially addresses BATCH-2290.
2014-12-22 16:57:16 -06:00
Michael Minella
7683700662 Filter out duplicate ApplicationContextAwareProcessors in parent/child
contexts scenarios

AbstractApplicationContextFactory, when configuring a child context,
copies all of the BeanPostProcessors from the parent to the child.
Normally this is a good thing.  However, in the case of teh
ApplicationContextAwareProcessor, the child context ends up with two
instances, one for the parent context and one for the child context.
This brings two issues to light:
  1. Unknown which context is being injected - On beans implementing
ApplicationContextAware, it can't be determined which context (the
parent or the child) will be injected since both BPPs will be called in
an indeterimant order.
 2. Errors occur with ApplicationObjectSupport - If the child context
contains a bean that extends ApplicationObjectSupport, when the second
ApplicationContextAwareProcessor is called, the bean will throw an
exception since it is only allowed to be initialized with one
application context.

This fix adds additional logic to remove the
ApplicationContextAwareProcessor from the parent context before adding
all the BPPs to the child.

This fix addresses BATCH-2319.
2014-11-05 16:34:51 -06:00
Chris Schaefer
8b26504db1 BATCH-2242: Stopping a job in STARTING state throws OptimisticLockingFailureException 2014-10-17 11:40:38 -05:00
Michael Minella
b8238908df Updated sequence initalization insert to be idempotent
BATCH-2159 provides a tweak to the insert statement used for
initializing the sequence tables used in the job repository database so
that they don't error if run multiple times as well as don't insert
multiple rows.
2014-10-17 11:12:12 -05:00
Michael Minella
f865eb0135 Add explicit call to afterPropertiesSet to a Flow when using Java config
When using java config, the call to SimpleFlow#afterPropertiesSet is not
called in all cases as noted in BATCH-2291.  This commit updates the
builder to explicitly make the call, and updates the SimpleFlow to be
idempotent for calls to afterPropertiesSet.
2014-10-15 14:36:13 -05:00
Michael Minella
8b22a6e98d Ignoring tests that I had unignored 2014-09-24 09:34:10 -05:00
Michael Minella
5b056e8126 Handle scenario where scanned item is filtered out
BATCH-2302 documents a scenario where an item throws an exception in a
fault tollerant step in the write, then in the process, throws an
exception as well.  This leads to an infinite loop.  To address this,
prior to attempting to write items during scanning we need to validate
that the there are items to be written (we were not which was causing a
NoSuchElementException when we did inputs.next().

This commit also removes an eronous System.out left in the
CoreNamespaceUtils.
2014-09-23 14:12:48 -05:00
Michael Minella
aee9dc2f6f Update stopped flag to volitile in SystemCommandTasklet
The SystemCommandTasklet checks a flag to determine if another thread
has requested that it be stopped.  Since this flag will be set via
another thread than the executing thread, it needs to be declared
volitile so that it's state is propigated across threads correctly.  The
documentation for StoppableTasklet has also been upadted to call out
that scenario.

This commit addresses Jira BATCH-2271
2014-09-22 15:39:17 -05:00
Michael Minella
19af4133eb Update DefaultBatchConfigurer to conform to @PostConstruct contracts
Prior to this commit the initialize method (which is annotated with
@PostConstruct) was throwing a checked exception wich goes against the
@PostConstruct contract.  We now wrap any checked exceptions in a
BatchConfigurationException and throw that.

This commit fixes (again) BATCH-2276
2014-09-22 14:19:59 -05:00
Michael Minella
a2f2df0b17 Conditionally add custom scopes when using XML configuration
When using a combination of Java configuration and the XML namespace
configuration, prior to this commit, we would add the batch custom
scopes twice which lead to issues.  This commit gives priority to the
custom scopes provided by the java configuration.  If you've used
@EnableBatchProcessing and have configured batch components using the
batch namespace, the custom scopes that come with the java config will
take precidence.

This commit addresses Jira BATCH-2266
2014-09-22 13:48:28 -05:00
Michael Minella
04b339b8f4 Add BeanCreationException to list of standard failure exceptions
Without this change, when passing an invalid job parameter to a bean
that is created internally by Spring Batch will cause a
BeanCreationException that is essentially ignored.  Due to it being
ignored, an infinite loop occurs in processing.
2014-09-16 11:01:30 -05:00
Chris Schaefer
47eba434d8 BATCH-1863: The batch namespace can not be used with allowBeanDefinitionOverriding=false 2014-09-15 15:05:26 -05:00
Chris Schaefer
587680ba56 XD-1027: Create script-based batch ItemProcessor 2014-07-18 11:55:17 -05:00
Michael Minella
8f8600c14d BATCH-2253: Added automatic registraiton of Job Scope to java config and
added support for a @JobScope annotation.
2014-07-18 11:55:17 -05:00
Michael Minella
752fe55e88 BATCH-2257: Added process skip count and filter count to the aggregate 2014-07-18 11:55:17 -05:00
Michael Minella
881de9ac16 BATCH-2251: Removed unused property from provided properties files 2014-07-18 11:55:17 -05:00
Chris Schaefer
0f5a7af1a3 Final attempt at fixing test failure on build machine. Works as expected in a cloned plan 2014-07-18 11:55:17 -05:00
Chris Schaefer
1f8cc9a557 Re-ignore.. apparently not the appropriate fix.. 2014-07-18 11:55:17 -05:00
Chris Schaefer
3b36c132d5 Remove @Ignore from test, fix build system issue 2014-07-18 11:55:17 -05:00
Chris Schaefer
cfe2bfb60d Temporarily ignore test until build issue is fixed 2014-07-18 11:55:17 -05:00
Michael Minella
751e7162a5 BATCH-2250: Added @FixMethodOrder(MethodSorters.JVM) to override new default method sorting by JUnit 4.11 2014-07-18 11:55:17 -05:00
Chris Schaefer
1ff1e6c7d0 BATCH-2242: Stopping a job in STARTING state throws OptimisticLockingFailureException 2014-07-18 11:55:17 -05:00
Michael Minella
6b6118263b BATCH-2247: Added creation of a JobExplorer by default to address the inability to create a Map based JobExplorer using java config 2014-07-18 11:55:16 -05:00
Michael Minella
e3e16f864b XD-1390: Updated SimpleJobRepository to return StepExecutions from previous run so UNKNOWN check will apply 2014-05-27 11:06:18 -05:00
Michael Minella
88f73791fb XD-1622: Add tasklet and step type to Step's ExecutionContext for XD usage 2014-05-23 15:47:23 -05:00
Michael Minella
f5d5edc52d BATCH-2235: Updated ExitStatus#isRunning logic to use correct strings 2014-05-22 11:31:41 -05:00
Michael Minella
936d966712 Added tests to address more situations as well as cleaned up logic a bit 2014-05-22 11:31:41 -05:00
Thomas Bosch
cc6be985ad Allow multiple configs (xmls, java-files, packages) to be loaded in
ApplicationContextFactory
2014-05-22 11:30:15 -05:00
Michael Minella
443cbba57f Added Serializable check so exception handling is consistent across 2.2.x and 3.0 2014-05-22 11:21:38 -05:00
Michael Minella
9affdaf04f BATCH-2212: Updated CommandLineJobRunner to better communicate exceptions 2014-05-21 17:49:30 -05:00
Michael Minella
3fb0b8a54f BATCH-2237: Added missing column to schema needed for JSR-352 based jobs 2014-05-21 12:57:33 -05:00
Michael Minella
3dc4c2906e Renamed JobExplorer#getJobInstancesByName to JobExplorer#findJobInstancesByName 2014-05-20 10:22:38 -05:00
Michael Minella
bb048f3cf8 BATCH-2234: Updated documentation to outline setup requirements as well as adding batch-*.properties files for the other database types 2014-05-16 11:21:13 -05:00
Michael Minella
39bb979a51 BATCH-2233: Moved JsrTestUtils to a location that is actually published with the release 2014-05-15 14:54:26 -05:00
Michael Minella
e7a4e348a5 BATCH-2229 & BATCH-2218: Removed OSGi related metadata and Maven POMs 2014-05-12 15:32:02 -05:00
Michael Minella
76af420116 Removed redundant casts 2014-05-07 16:34:08 -05:00
Chris Schaefer
57f409e0f1 update copyright dates, fix test method typo, xml cleanup, add varg - for BATCH-2227 2014-05-07 12:29:49 -04:00
Thomas Bosch
90aca9c98b BATCH-2227: Allow multiple configs (xmls, java-files, packages) to be
loaded in ApplicationContextFactory
2014-05-07 12:29:08 -04:00
Michael Minella
6d94ae9031 Updated hsqldb urls to use MVCC mode 2014-05-05 15:08:05 -05:00
Chris Schaefer
3a1f6a27d6 Add wildcard search functionality from BATCH-1797 to MapJobInstanceDao and tests 2014-05-05 15:00:37 -04:00
willschipp
aef4db98b8 BATCH-1797 - implementation of SQL 'wildcard' search in JobInstanceDao 2014-05-05 15:00:37 -04:00
Michael Minella
e8962cec39 Initial commit of package detangle work 2014-05-05 10:42:32 -05:00
Michael Minella
6913f5c022 Updated Spring Retry to 1.1.0.RC1 2014-05-02 13:04:31 -05:00
Chris Schaefer
bd01760466 add test case for BATCH-2025 2014-05-01 19:32:36 -04:00
willschipp
166686bd9a BATCH-2025 added setter for useAllParentParameters 2014-05-01 18:21:00 -04:00
Michael Minella
5e07b249ad Updated commons-dbcp and commons-pool dependency scopes 2014-04-25 15:30:23 -05:00
Michael Minella
54b3fe0b3a BATCH-2144: Removed OSGi ApplicationContextFactory 2014-04-25 09:36:49 -05:00
Gunnar Hillert
11a8ec1dc4 BATCH-2144 - Merged Michael's changes
* Merge PR https://github.com/ghillert/spring-batch/pull/1
* Update Spring Integration dependency to 4.0.0.RC1
* Update docbook-reference-plugin to 0.2.8
2014-04-24 12:16:17 -05:00
Gunnar Hillert
f1d71a06f4 BATCH-2144 Convert Spring Batch to use Gradle
* Use Gradle 1.11
* Remove SpringSource references
* Update JavaDoc overview
* Update Jacoco conf + Add license/manifest files
* Addresses also BATCH-2187
* Update a number of unit tests to not be ignored

Jira: https://jira.springsource.org/browse/BATCH-2144
2014-04-24 12:16:17 -05:00