3
pom.xml
3
pom.xml
@@ -87,6 +87,9 @@
|
||||
<mongodb-driver-sync.version>4.9.1</mongodb-driver-sync.version>
|
||||
<junit-jupiter.version>5.9.3</junit-jupiter.version>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<jsr305.version>3.0.2</jsr305.version>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<micrometer-tracing.version>1.0.5</micrometer-tracing.version>
|
||||
|
||||
|
||||
@@ -328,6 +328,14 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>${jsr305.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Entity implements Serializable {
|
||||
|
||||
/**
|
||||
* Default constructor for {@link Entity}.
|
||||
*
|
||||
* <p>
|
||||
* The ID defaults to zero.
|
||||
*/
|
||||
public Entity() {
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.io.StringWriter;
|
||||
|
||||
/**
|
||||
* Value object used to carry information about the status of a job or step execution.
|
||||
*
|
||||
* <p>
|
||||
* {@code ExitStatus} is immutable and, therefore, thread-safe.
|
||||
*
|
||||
* @author Dave Syer
|
||||
|
||||
@@ -305,7 +305,7 @@ public class JobExecution extends Entity {
|
||||
/**
|
||||
* Package-private method for re-constituting the step executions from existing
|
||||
* instances.
|
||||
* @param The {@code stepExecution} execution to be added.
|
||||
* @param stepExecution The {@code stepExecution} execution to be added.
|
||||
*/
|
||||
void addStepExecution(StepExecution stepExecution) {
|
||||
stepExecutions.add(stepExecution);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,7 @@ import org.springframework.util.Assert;
|
||||
* Batch domain object representing a uniquely identifiable job run. {@code JobInstance}
|
||||
* can be restarted multiple times in case of execution failure, and its lifecycle ends
|
||||
* with first successful execution.
|
||||
*
|
||||
* <p>
|
||||
* Trying to execute an existing {@code JobInstance} that has already completed
|
||||
* successfully results in an error. An error is also raised for an attempt to restart a
|
||||
* failed {@code JobInstance} if the {@code Job} is not restartable.
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.springframework.util.Assert;
|
||||
* order to determine if one {@code JobParameters} object equals another. Furthermore,
|
||||
* because these parameters need to be persisted, it is vital that the types added are
|
||||
* restricted.
|
||||
*
|
||||
* <p>
|
||||
* This class is immutable and, therefore, thread-safe.
|
||||
*
|
||||
* @author Lucas Ward
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,7 @@ public interface StepExecutionListener extends StepListener {
|
||||
* Give a listener a chance to modify the exit status from a step. The value returned
|
||||
* is combined with the normal exit status by using
|
||||
* {@link ExitStatus#and(ExitStatus)}.
|
||||
*
|
||||
* <p>
|
||||
* Called after execution of the step's processing logic (whether successful or
|
||||
* failed). Throwing an exception in this method has no effect, as it is only logged.
|
||||
* @param stepExecution a {@link StepExecution} instance.
|
||||
|
||||
@@ -74,7 +74,7 @@ import org.springframework.transaction.annotation.Isolation;
|
||||
/**
|
||||
* Base {@link Configuration} class that provides common JDBC-based infrastructure beans
|
||||
* for enabling and using Spring Batch.
|
||||
*
|
||||
* <p>
|
||||
* This configuration class configures and registers the following beans in the
|
||||
* application context:
|
||||
*
|
||||
@@ -89,10 +89,8 @@ import org.springframework.transaction.annotation.Isolation;
|
||||
* </ul>
|
||||
*
|
||||
* Customization is possible by extending the class and overriding getters.
|
||||
*
|
||||
* A typical usage of this class is as follows:
|
||||
*
|
||||
* <pre class="code">
|
||||
* <p>
|
||||
* A typical usage of this class is as follows: <pre class="code">
|
||||
* @Configuration
|
||||
* public class MyJobConfiguration extends DefaultBatchConfiguration {
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -138,9 +138,6 @@ public class GenericApplicationContextFactory extends AbstractApplicationContext
|
||||
|
||||
private final ApplicationContextHelper helper;
|
||||
|
||||
/**
|
||||
* @param parent
|
||||
*/
|
||||
public ResourceXmlApplicationContext(ConfigurableApplicationContext parent, Object... resources) {
|
||||
|
||||
class ResourceXmlApplicationContextHelper extends ApplicationContextHelper {
|
||||
|
||||
@@ -265,7 +265,7 @@ public class ChunkElementParser {
|
||||
|
||||
/**
|
||||
* Handle the adapter method attribute by using an
|
||||
* {@link AbstractMethodInvokingDelegator}.
|
||||
* {@link org.springframework.batch.item.adapter.AbstractMethodInvokingDelegator}.
|
||||
*/
|
||||
private void handleAdapterMethodAttribute(String propertyName, String adapterClassName,
|
||||
MutablePropertyValues stepPvs, Element element) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2021 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -60,8 +60,8 @@ public class CoreNamespacePostProcessor
|
||||
/**
|
||||
* Automatically inject job-repository from a job into its steps. Only inject if the
|
||||
* step is an AbstractStep or StepParserStepFactoryBean.
|
||||
* @param beanName
|
||||
* @param beanFactory
|
||||
* @param beanName the bean name
|
||||
* @param beanFactory the bean factory
|
||||
*/
|
||||
private void injectJobRepositoryIntoSteps(String beanName, ConfigurableListableBeanFactory beanFactory) {
|
||||
BeanDefinition bd = beanFactory.getBeanDefinition(beanName);
|
||||
@@ -87,8 +87,8 @@ public class CoreNamespacePostProcessor
|
||||
/**
|
||||
* If any of the beans in the parent hierarchy is a <step/> with a
|
||||
* <tasklet/>, then the bean class must be {@link StepParserStepFactoryBean}.
|
||||
* @param beanName
|
||||
* @param beanFactory
|
||||
* @param beanName the bean name
|
||||
* @param beanFactory the bean factory
|
||||
*/
|
||||
private void overrideStepClass(String beanName, ConfigurableListableBeanFactory beanFactory) {
|
||||
BeanDefinition bd = beanFactory.getBeanDefinition(beanName);
|
||||
@@ -111,8 +111,8 @@ public class CoreNamespacePostProcessor
|
||||
* <li>Inject "transactionManager" into any {@link StepParserStepFactoryBean} without
|
||||
* a transactionManager.
|
||||
* </ul>
|
||||
* @param bean
|
||||
* @return
|
||||
* @param bean the bean object
|
||||
* @return the bean with default collaborators injected into it
|
||||
*/
|
||||
private Object injectDefaults(Object bean) {
|
||||
if (bean instanceof JobParserJobFactoryBean) {
|
||||
|
||||
@@ -103,7 +103,7 @@ public class CoreNamespaceUtils {
|
||||
|
||||
/**
|
||||
* Register a {@link Comparator} to be used to sort {@link StateTransition} objects.
|
||||
* @param parserContext
|
||||
* @param parserContext the parser context
|
||||
*/
|
||||
private static void addStateTransitionComparator(ParserContext parserContext) {
|
||||
BeanDefinitionRegistry registry = parserContext.getRegistry();
|
||||
@@ -122,7 +122,7 @@ public class CoreNamespaceUtils {
|
||||
|
||||
/**
|
||||
* Register a {@code RangePropertyEditor}, if one does not already exist.
|
||||
* @param parserContext
|
||||
* @param parserContext the parser context
|
||||
*/
|
||||
private static void addRangePropertyEditor(ParserContext parserContext) {
|
||||
BeanDefinitionRegistry registry = parserContext.getRegistry();
|
||||
@@ -164,7 +164,7 @@ public class CoreNamespaceUtils {
|
||||
|
||||
/**
|
||||
* Add a core name postprocessor.
|
||||
* @param parserContext
|
||||
* @param parserContext the parser context
|
||||
*/
|
||||
private static void addCoreNamespacePostProcessor(ParserContext parserContext) {
|
||||
BeanDefinitionRegistry registry = parserContext.getRegistry();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -137,8 +137,8 @@ public class SimpleFlowFactoryBean implements FactoryBean<SimpleFlow>, Initializ
|
||||
* Convenience method to get a state that proxies the input but with a different name,
|
||||
* appropriate to this flow. If the state is a {@link StepState}, the step name is
|
||||
* also changed.
|
||||
* @param state
|
||||
* @return
|
||||
* @param state the state to proxy
|
||||
* @return the proxy state
|
||||
*/
|
||||
private State getProxyState(State state) {
|
||||
String oldName = state.getName();
|
||||
|
||||
@@ -552,7 +552,7 @@ public class StepParserStepFactoryBean<I, O> implements FactoryBean<Step>, BeanN
|
||||
* present).
|
||||
* @param value The value of the other field.
|
||||
* @param twoWayDependency Set to {@code true} if both depend on each other.
|
||||
* @throws an IllegalArgumentException if either condition is violated
|
||||
* @throws IllegalArgumentException if either condition is violated
|
||||
*/
|
||||
private void validateDependency(String dependentName, Object dependentValue, String name, Object value,
|
||||
boolean twoWayDependency) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link java.util.Date} to {@link String}.
|
||||
*
|
||||
* <p>
|
||||
* This converter formats dates according to the
|
||||
* {@link java.time.format.DateTimeFormatter#ISO_INSTANT} format.
|
||||
*
|
||||
|
||||
@@ -32,9 +32,9 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* Converter for {@link JobParameters} instances that uses a simple naming convention for
|
||||
* converting job parameters. The expected notation is the following:
|
||||
*
|
||||
* <p>
|
||||
* key=value,type,identifying
|
||||
*
|
||||
* <p>
|
||||
* where:
|
||||
*
|
||||
* <ul>
|
||||
@@ -47,12 +47,12 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* For example, schedule.date=2022-12-12,java.time.LocalDate will be converted to an
|
||||
* identifying job parameter of type {@link java.time.LocalDate} with value "2022-12-12".
|
||||
*
|
||||
* <p>
|
||||
* The literal values are converted to the target type by using the default Spring
|
||||
* conversion service, augmented if necessary by any custom converters. The conversion
|
||||
* service should be configured with a converter to and from string literals to job
|
||||
* parameter types.
|
||||
*
|
||||
* <p>
|
||||
* By default, the Spring conversion service is augmented to support the conversion of the
|
||||
* following types:
|
||||
*
|
||||
|
||||
@@ -24,10 +24,10 @@ import org.springframework.batch.core.JobParameters;
|
||||
/**
|
||||
* Converter for {@link JobParameters} instances that uses a JSON naming convention for
|
||||
* converting job parameters. The expected notation is the following:
|
||||
*
|
||||
* <p>
|
||||
* key='{"value": "parameterStringLiteralValue",
|
||||
* "type":"fully.qualified.name.of.the.parameter.Type", "identifying": "booleanValue"}'
|
||||
*
|
||||
* <p>
|
||||
* where:
|
||||
*
|
||||
* <ul>
|
||||
@@ -41,12 +41,12 @@ import org.springframework.batch.core.JobParameters;
|
||||
* For example, schedule.date={"value": "2022-12-12", "type":"java.time.LocalDate",
|
||||
* "identifying": "false"} will be converted to a non identifying job parameter of type
|
||||
* {@link java.time.LocalDate} with value "2022-12-12".
|
||||
*
|
||||
* <p>
|
||||
* The literal values are converted to the correct type by using the default Spring
|
||||
* conversion service, augmented if necessary by any custom converters. The conversion
|
||||
* service should be configured with a converter to and from string literals to job
|
||||
* parameter types.
|
||||
*
|
||||
* <p>
|
||||
* By default, the Spring conversion service is augmented to support the conversion of the
|
||||
* following types:
|
||||
*
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link LocalDateTime} to {@link String}.
|
||||
*
|
||||
* <p>
|
||||
* This converter formats dates according to the
|
||||
* {@link DateTimeFormatter#ISO_LOCAL_DATE_TIME} format.
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link LocalDate} to {@link String}.
|
||||
*
|
||||
* <p>
|
||||
* This converter formats dates according to the
|
||||
* {@link java.time.format.DateTimeFormatter#ISO_LOCAL_DATE} format.
|
||||
*
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link LocalTime} to {@link String}.
|
||||
*
|
||||
* <p>
|
||||
* This converter formats times according to the {@link DateTimeFormatter#ISO_LOCAL_TIME}
|
||||
* format.
|
||||
*
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link String} to {@link java.util.Date}.
|
||||
*
|
||||
* <p>
|
||||
* This converter expects strings in the
|
||||
* {@link java.time.format.DateTimeFormatter#ISO_INSTANT} format.
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link String} to {@link LocalDate}.
|
||||
*
|
||||
* <p>
|
||||
* This converter expects strings in the
|
||||
* {@link java.time.format.DateTimeFormatter#ISO_LOCAL_DATE} format.
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link String} to {@link LocalDateTime}.
|
||||
*
|
||||
* <p>
|
||||
* This converter expects strings in the
|
||||
* {@link java.time.format.DateTimeFormatter#ISO_LOCAL_DATE_TIME} format.
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* {@link Converter} implementation from {@link String} to {@link LocalTime}.
|
||||
*
|
||||
* <p>
|
||||
* This converter expects strings in the
|
||||
* {@link java.time.format.DateTimeFormatter#ISO_LOCAL_TIME} format.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -113,7 +113,7 @@ public interface JobExplorer {
|
||||
* depending on the implementation. In that case, use
|
||||
* {@link #getStepExecution(Long, Long)} to hydrate them.
|
||||
* @param jobInstance The {@link JobInstance} to query.
|
||||
* @return the set of all executions for the specified {@link JobInstance}.
|
||||
* @return the list of all executions for the specified {@link JobInstance}.
|
||||
*/
|
||||
List<JobExecution> getJobExecutions(JobInstance jobInstance);
|
||||
|
||||
@@ -145,7 +145,7 @@ public interface JobExplorer {
|
||||
/**
|
||||
* Query the repository for all unique {@link JobInstance} names (sorted
|
||||
* alphabetically).
|
||||
* @return the set of job names that have been executed.
|
||||
* @return the list of job names that have been executed.
|
||||
*/
|
||||
List<String> getJobNames();
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public class JobExplorerFactoryBean extends AbstractJobExplorerFactoryBean imple
|
||||
|
||||
/**
|
||||
* Sets the data source.
|
||||
*
|
||||
* <p>
|
||||
* Public setter for the {@link DataSource}.
|
||||
* @param dataSource A {@code DataSource}.
|
||||
*/
|
||||
|
||||
@@ -572,7 +572,7 @@ public class FlowBuilder<Q> {
|
||||
*
|
||||
* In this example, a flow consisting of <code>step1</code> will be executed in
|
||||
* parallel with <code>flow</code>.
|
||||
*
|
||||
* <p>
|
||||
* <em>Note:</em> Adding a split to a chain of states is not supported. For example,
|
||||
* the following configuration is not supported. Instead, the configuration would need
|
||||
* to create a flow3 that was the split flow and assemble them separately.
|
||||
|
||||
@@ -88,10 +88,6 @@ public class FlowJob extends AbstractJob {
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flow
|
||||
* @param map
|
||||
*/
|
||||
private void findSteps(Flow flow, Map<String, Step> map) {
|
||||
|
||||
for (State state : flow.getStates()) {
|
||||
|
||||
@@ -385,7 +385,7 @@ public class CommandLineJobRunner {
|
||||
/**
|
||||
* @param jobIdentifier a job execution id or job name
|
||||
* @param minStatus the highest status to exclude from the result
|
||||
* @return
|
||||
* @return the list of job executions with status greater than minStatus
|
||||
*/
|
||||
private List<JobExecution> getJobExecutionsWithStatusGreaterThan(String jobIdentifier, BatchStatus minStatus) {
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ public class JobRegistryBackgroundJobRunner {
|
||||
* and followed by the children. The parent must contain a {@link JobRegistry} and the
|
||||
* child contexts are expected to contain {@link Job} definitions, each of which will
|
||||
* be registered wit the registry.
|
||||
*
|
||||
* <p>
|
||||
* Example usage:
|
||||
*
|
||||
* <pre>
|
||||
@@ -182,7 +182,7 @@ public class JobRegistryBackgroundJobRunner {
|
||||
* The child contexts are created only when needed though the {@link JobFactory}
|
||||
* interface (but the XML is validated on startup by using it to create a
|
||||
* {@link BeanFactory} which is then discarded).
|
||||
*
|
||||
* <p>
|
||||
* The parent context is created in a separate thread, and the program will pause for
|
||||
* input in an infinite loop until the user hits any key.
|
||||
* @param args the context locations to use (first one is for parent)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -51,7 +51,7 @@ import org.springframework.util.Assert;
|
||||
* Care should be taken to ensure any users of this class understand fully whether or not
|
||||
* the implementation of TaskExecutor used will start tasks synchronously or
|
||||
* asynchronously. The default setting uses a synchronous task executor.
|
||||
*
|
||||
* <p>
|
||||
* There is only one required dependency of this Launcher, a {@link JobRepository}. The
|
||||
* JobRepository is used to obtain a valid JobExecution. The Repository must be used
|
||||
* because the provided {@link Job} could be a restart of an existing {@link JobInstance},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2022 the original author or authors.
|
||||
* Copyright 2022-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,7 +36,7 @@ import org.springframework.core.task.TaskExecutor;
|
||||
* of this class understand fully whether or not the implementation of TaskExecutor used
|
||||
* will start tasks synchronously or asynchronously. The default setting uses a
|
||||
* synchronous task executor.
|
||||
*
|
||||
* <p>
|
||||
* There is only one required dependency of this Launcher, a {@link JobRepository}. The
|
||||
* JobRepository is used to obtain a valid JobExecution. The Repository must be used
|
||||
* because the provided {@link Job} could be a restart of an existing {@link JobInstance},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.ObjectUtils;
|
||||
* {@link ExecutionContext} to the {@link Job} {@link ExecutionContext} at the end of a
|
||||
* step. A list of keys should be provided that correspond to the items in the
|
||||
* {@link Step} {@link ExecutionContext} that should be promoted.
|
||||
*
|
||||
* <p>
|
||||
* Additionally, an optional list of statuses can be set to indicate for which exit status
|
||||
* codes the promotion should occur. These statuses will be checked using the
|
||||
* {@link PatternMatcher}, so wildcards are allowed. By default, promotion will only occur
|
||||
|
||||
@@ -43,7 +43,7 @@ class OrderedComposite<S> {
|
||||
|
||||
/**
|
||||
* Public setter for the listeners.
|
||||
* @param items
|
||||
* @param items to set
|
||||
*/
|
||||
public void setItems(List<? extends S> items) {
|
||||
unordered.clear();
|
||||
@@ -55,7 +55,7 @@ class OrderedComposite<S> {
|
||||
|
||||
/**
|
||||
* Register additional item.
|
||||
* @param item
|
||||
* @param item to add
|
||||
*/
|
||||
public void add(S item) {
|
||||
if (item instanceof Ordered) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -46,6 +46,7 @@ import org.springframework.batch.core.annotation.OnSkipInWrite;
|
||||
import org.springframework.batch.core.annotation.OnWriteError;
|
||||
import org.springframework.batch.core.scope.context.ChunkContext;
|
||||
import org.springframework.batch.item.Chunk;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Enumeration for {@link StepListener} meta data, which ties together the names of
|
||||
@@ -140,6 +141,7 @@ public enum StepListenerMetaData implements ListenerMetaData {
|
||||
* @param propertyName property name to retrieve data for.
|
||||
* @return meta data with supplied property name, null if none exists.
|
||||
*/
|
||||
@Nullable
|
||||
public static StepListenerMetaData fromPropertyName(String propertyName) {
|
||||
return propertyMap.get(propertyName);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 the original author or authors.
|
||||
* Copyright 2019-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -93,7 +93,7 @@ public final class BatchMetrics {
|
||||
/**
|
||||
* Create a new {@link Observation}. It's not started, you must explicitly call
|
||||
* {@link Observation#start()} to start it.
|
||||
*
|
||||
* <p>
|
||||
* Remember to register the {@link DefaultMeterObservationHandler} via the
|
||||
* {@code Metrics.globalRegistry.withTimerObservationHandler()} in the user code.
|
||||
* Otherwise you won't observe any metrics.
|
||||
@@ -110,7 +110,7 @@ public final class BatchMetrics {
|
||||
/**
|
||||
* Create a new {@link Observation}. It's not started, you must explicitly call
|
||||
* {@link Observation#start()} to start it.
|
||||
*
|
||||
* <p>
|
||||
* Remember to register the {@link DefaultMeterObservationHandler} via the
|
||||
* {@code Metrics.globalRegistry.withTimerObservationHandler()} in the user code.
|
||||
* Otherwise you won't observe any metrics.
|
||||
|
||||
@@ -137,7 +137,7 @@ public interface JobRepository {
|
||||
|
||||
/**
|
||||
* Update the {@link JobExecution} (but not its {@link ExecutionContext}).
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: {@link JobExecution} must contain a valid {@link JobInstance} and be
|
||||
* saved (have an id assigned).
|
||||
* @param jobExecution {@link JobExecution} instance to be updated in the repo.
|
||||
@@ -148,7 +148,7 @@ public interface JobRepository {
|
||||
* Save the {@link StepExecution} and its {@link ExecutionContext}. ID will be
|
||||
* assigned - it is not permitted that an ID be assigned before calling this method.
|
||||
* Instead, it should be left blank, to be assigned by a {@link JobRepository}.
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: {@link StepExecution} must have a valid {@link Step}.
|
||||
* @param stepExecution {@link StepExecution} instance to be added to the repo.
|
||||
*/
|
||||
@@ -159,7 +159,7 @@ public interface JobRepository {
|
||||
* StepExecution ID will be assigned - it is not permitted that an ID be assigned
|
||||
* before calling this method. Instead, it should be left blank, to be assigned by
|
||||
* {@link JobRepository}.
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: {@link StepExecution} must have a valid {@link Step}.
|
||||
* @param stepExecutions collection of {@link StepExecution} instances to be added to
|
||||
* the repo.
|
||||
@@ -168,7 +168,7 @@ public interface JobRepository {
|
||||
|
||||
/**
|
||||
* Update the {@link StepExecution} (but not its {@link ExecutionContext}).
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: {@link StepExecution} must be saved (have an id assigned).
|
||||
* @param stepExecution {@link StepExecution} instance to be updated in the repo.
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* JDBC DAO for {@link ExecutionContext}.
|
||||
*
|
||||
* <p>
|
||||
* Stores execution context data related to both Step and Job using a different table for
|
||||
* each.
|
||||
*
|
||||
@@ -269,8 +269,8 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executionId
|
||||
* @param serializedContext
|
||||
* @param executionId the job or step execution id
|
||||
* @param serializedContext the serialized context to persist
|
||||
* @param sql with parameters (shortContext, longContext, executionId)
|
||||
*/
|
||||
private void persistSerializedContext(final Long executionId, String serializedContext, String sql) {
|
||||
@@ -301,7 +301,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
|
||||
}
|
||||
|
||||
/**
|
||||
* @param serializedContexts
|
||||
* @param serializedContexts the execution contexts to serialize
|
||||
* @param sql with parameters (shortContext, longContext, executionId)
|
||||
*/
|
||||
private void persistSerializedContexts(final Map<Long, String> serializedContexts, String sql) {
|
||||
|
||||
@@ -249,8 +249,8 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
|
||||
|
||||
/**
|
||||
* Validate JobExecution. At a minimum, JobId, Status, CreateTime cannot be null.
|
||||
* @param jobExecution
|
||||
* @throws IllegalArgumentException
|
||||
* @param jobExecution the job execution to validate
|
||||
* @throws IllegalArgumentException if the job execution is invalid
|
||||
*/
|
||||
private void validateJobExecution(JobExecution jobExecution) {
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
|
||||
/**
|
||||
* Validate StepExecution. At a minimum, JobId, CreateTime, and Status cannot be null.
|
||||
* EndTime can be null for an unfinished job.
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IllegalArgumentException if the step execution is invalid
|
||||
*/
|
||||
private void validateStepExecution(StepExecution stepExecution) {
|
||||
Assert.notNull(stepExecution, "stepExecution is required");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,7 +34,7 @@ public interface JobExecutionDao {
|
||||
|
||||
/**
|
||||
* Save a new JobExecution.
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: jobInstance the jobExecution belongs to must have a jobInstanceId.
|
||||
* @param jobExecution {@link JobExecution} instance to be saved.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public interface JobExecutionDao {
|
||||
|
||||
/**
|
||||
* Update and existing JobExecution.
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: jobExecution must have an Id (which can be obtained by the save
|
||||
* method) and a jobInstanceId.
|
||||
* @param jobExecution {@link JobExecution} instance to be updated.
|
||||
|
||||
@@ -37,9 +37,9 @@ public interface JobInstanceDao {
|
||||
|
||||
/**
|
||||
* Create a JobInstance with given name and parameters.
|
||||
*
|
||||
* <p>
|
||||
* PreConditions: JobInstance for given name and parameters must not already exist
|
||||
*
|
||||
* <p>
|
||||
* PostConditions: A valid job instance will be returned which has been persisted and
|
||||
* contains an unique Id.
|
||||
* @param jobName {@link String} containing the name of the job.
|
||||
@@ -80,7 +80,7 @@ public interface JobInstanceDao {
|
||||
/**
|
||||
* Fetch the last job instances with the provided name, sorted backwards by primary
|
||||
* key.
|
||||
*
|
||||
* <p>
|
||||
* if using the JdbcJobInstance, you can provide the jobName with a wildcard (e.g.
|
||||
* *Job) to return 'like' job names. (e.g. *Job will return 'someJob' and 'otherJob')
|
||||
* @param jobName the job name
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,9 +27,9 @@ public interface StepExecutionDao {
|
||||
|
||||
/**
|
||||
* Save the given StepExecution.
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: Id must be null.
|
||||
*
|
||||
* <p>
|
||||
* Postconditions: Id will be set to a unique Long.
|
||||
* @param stepExecution {@link StepExecution} instance to be saved.
|
||||
*/
|
||||
@@ -37,9 +37,9 @@ public interface StepExecutionDao {
|
||||
|
||||
/**
|
||||
* Save the given collection of StepExecution as a batch.
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: StepExecution Id must be null.
|
||||
*
|
||||
* <p>
|
||||
* Postconditions: StepExecution Id will be set to a unique Long.
|
||||
* @param stepExecutions a collection of {@link JobExecution} instances to be saved.
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ public interface StepExecutionDao {
|
||||
|
||||
/**
|
||||
* Update the given StepExecution
|
||||
*
|
||||
* <p>
|
||||
* Preconditions: Id must not be null.
|
||||
* @param stepExecution {@link StepExecution} instance to be updated.
|
||||
*/
|
||||
|
||||
@@ -283,7 +283,7 @@ public class SimpleJobRepository implements JobRepository {
|
||||
* provided StepExecution has been interrupted. If, after synchronizing the status
|
||||
* with the database, the status has been updated to STOPPING, then the job has been
|
||||
* interrupted.
|
||||
* @param stepExecution
|
||||
* @param stepExecution the step execution
|
||||
*/
|
||||
private void checkForInterruption(StepExecution stepExecution) {
|
||||
JobExecution jobExecution = stepExecution.getJobExecution();
|
||||
|
||||
@@ -689,7 +689,7 @@ public class FaultTolerantStepBuilder<I, O> extends SimpleStepBuilder<I, O> {
|
||||
/**
|
||||
* ChunkListener that wraps exceptions thrown from the ChunkListener in
|
||||
* {@link FatalStepExecutionException} to force termination of StepExecution
|
||||
*
|
||||
* <p>
|
||||
* ChunkListeners shoulnd't throw exceptions and expect continued processing, they
|
||||
* must be handled in the implementation or the step will terminate
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,7 +38,7 @@ import org.springframework.retry.policy.RetryContextCache;
|
||||
* Factory bean for step that provides options for configuring skip behavior. User can set
|
||||
* {@link #setSkipLimit(int)} to set how many exceptions of
|
||||
* {@link #setSkippableExceptionClasses(Map)} types are tolerated.
|
||||
*
|
||||
* <p>
|
||||
* Skippable exceptions on write will by default cause transaction rollback - to avoid
|
||||
* rollback for specific exception class include it in the transaction attribute as "no
|
||||
* rollback for".
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -51,7 +51,7 @@ import org.springframework.transaction.interceptor.TransactionAttribute;
|
||||
/**
|
||||
* Most common configuration options for simple steps should be found here. Use this
|
||||
* factory bean instead of creating a {@link Step} implementation manually.
|
||||
*
|
||||
* <p>
|
||||
* This factory does not support configuration of fault-tolerant behavior, use appropriate
|
||||
* subclass of this factory bean to configure skip or retry.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2013 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,7 +21,7 @@ import org.springframework.batch.core.ExitStatus;
|
||||
/**
|
||||
* Simple {@link SystemProcessExitCodeMapper} implementation that performs following
|
||||
* mapping:
|
||||
*
|
||||
* <p>
|
||||
* 0 -> ExitStatus.FINISHED else -> ExitStatus.FAILED
|
||||
*
|
||||
* @author Robert Kasanicky
|
||||
|
||||
@@ -41,18 +41,18 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* {@link Tasklet} that executes a system command.
|
||||
*
|
||||
* <p>
|
||||
* The system command is executed asynchronously using injected
|
||||
* {@link #setTaskExecutor(TaskExecutor)} - timeout value is required to be set, so that
|
||||
* the batch job does not hang forever if the external process hangs.
|
||||
*
|
||||
* <p>
|
||||
* Tasklet periodically checks for termination status (i.e. {@link #setCommand(String...)}
|
||||
* finished its execution or {@link #setTimeout(long)} expired or job was interrupted).
|
||||
* The check interval is given by {@link #setTerminationCheckInterval(long)}.
|
||||
*
|
||||
* <p>
|
||||
* When job interrupt is detected tasklet's execution is terminated immediately by
|
||||
* throwing {@link JobInterruptedException}.
|
||||
*
|
||||
* <p>
|
||||
* {@link #setInterruptOnCancel(boolean)} specifies whether the tasklet should attempt to
|
||||
* interrupt the thread that executes the system command if it is still running when
|
||||
* tasklet exits (abnormally).
|
||||
|
||||
@@ -194,10 +194,6 @@ class ExtendedAbstractJobTests {
|
||||
*/
|
||||
private static class StubJob extends AbstractJob {
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* @param jobRepository
|
||||
*/
|
||||
private StubJob(String name, JobRepository jobRepository) {
|
||||
super(name);
|
||||
try {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class JobSupport implements BeanNameAware, Job, StepLocator {
|
||||
|
||||
/**
|
||||
* Convenience constructor to immediately add name (which is mandatory but not final).
|
||||
* @param name
|
||||
* @param name the job name
|
||||
*/
|
||||
public JobSupport(String name) {
|
||||
super();
|
||||
|
||||
@@ -544,23 +544,17 @@ class SimpleJobTests {
|
||||
private ExecutionContext passedInJobContext;
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param string the step name
|
||||
*/
|
||||
public StubStep(String string, JobRepository jobRepository) {
|
||||
super(string);
|
||||
this.jobRepository = jobRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exception
|
||||
*/
|
||||
public void setProcessException(Throwable exception) {
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param runnable
|
||||
*/
|
||||
public void setCallback(Runnable runnable) {
|
||||
this.runnable = runnable;
|
||||
}
|
||||
|
||||
@@ -702,11 +702,6 @@ public class FlowJobTests {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jobExecution
|
||||
* @param stepName
|
||||
* @return the StepExecution corresponding to the specified step
|
||||
*/
|
||||
private StepExecution getStepExecution(JobExecution jobExecution, String stepName) {
|
||||
for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
|
||||
if (stepExecution.getStepName().equals(stepName)) {
|
||||
|
||||
@@ -220,7 +220,7 @@ class SimpleFlowTests {
|
||||
protected static class StubState extends StateSupport {
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param string the state name
|
||||
*/
|
||||
public StubState(String string) {
|
||||
super(string);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,11 +22,11 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.batch.core.BatchStatus;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.job.flow.FlowExecutionStatus;
|
||||
import org.springframework.batch.core.job.flow.FlowExecutor;
|
||||
import org.springframework.batch.core.job.flow.support.JobFlowExecutorSupport;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
* @author Mahmoud Ben Hassine
|
||||
*
|
||||
*/
|
||||
class EndStateTests {
|
||||
@@ -38,10 +38,6 @@ class EndStateTests {
|
||||
jobExecution = new JobExecution(0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link EndState#handle(FlowExecutor)}.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testHandleRestartSunnyDay() throws Exception {
|
||||
|
||||
@@ -59,10 +55,6 @@ class EndStateTests {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link EndState#handle(FlowExecutor)}.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testHandleOngoingSunnyDay() throws Exception {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2022 the original author or authors.
|
||||
* Copyright 2009-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,7 +48,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: ExecutionContext contains {key, key2}. keys = {key}. statuses is not set
|
||||
* (defaults to {COMPLETED}).
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -77,7 +77,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: ExecutionContext contains {key, key2}. keys = {key, key2}. statuses =
|
||||
* {status}. ExitStatus = status
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -108,7 +108,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: ExecutionContext contains {key, key2}. keys = {key, key2}. statuses =
|
||||
* {status}. ExitStatus = status2
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: no promotions.
|
||||
*/
|
||||
@Test
|
||||
@@ -137,7 +137,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
|
||||
/**
|
||||
* CONDITION: keys = {key, key2}. statuses = {statusWildcard}. ExitStatus = status
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -166,7 +166,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
|
||||
/**
|
||||
* CONDITION: keys = {key, key2}. Only {key} exists in the ExecutionContext.
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is promoted. key2 is not.
|
||||
*/
|
||||
@Test
|
||||
@@ -193,7 +193,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
|
||||
/**
|
||||
* CONDITION: keys = {key}. key is already in job but not in step.
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: key is not erased.
|
||||
*/
|
||||
@Test
|
||||
@@ -220,7 +220,7 @@ class ExecutionContextPromotionListenerTests {
|
||||
/**
|
||||
* CONDITION: strict = true. keys = {key, key2}. Only {key} exists in the
|
||||
* ExecutionContext.
|
||||
*
|
||||
* <p>
|
||||
* EXPECTED: IllegalArgumentException
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -264,7 +263,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -275,7 +274,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -289,7 +288,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -300,7 +299,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -314,7 +313,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
@@ -325,7 +324,7 @@ class MulticasterBatchListenerTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, java.util.List)}
|
||||
* {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, Chunk)}
|
||||
* .
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -80,9 +80,8 @@ class SimpleStepExecutionSplitterTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Tests the results of BATCH-2490
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testAddressabilityOfSetResults() throws Exception {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2013 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -45,7 +45,7 @@ public class StepSupport implements Step, BeanNameAware {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param string the step name
|
||||
*/
|
||||
public StepSupport(String string) {
|
||||
super();
|
||||
|
||||
@@ -88,12 +88,11 @@ class RegisterMultiListenerTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* The times the beforeChunkCalled occurs are: - Before chunk 1 (item1, item2) -
|
||||
* Before the re-attempt of item1 (scanning) - Before the re-attempt of item2
|
||||
* (scanning) - Before the checking that scanning is complete - Before chunk 2 (item3,
|
||||
* item4) - Before chunk 3 (null)
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testMultiListenerFaultTolerantStep() throws Exception {
|
||||
|
||||
@@ -185,7 +185,6 @@ class FaultTolerantChunkProcessorTests {
|
||||
|
||||
/**
|
||||
* An Error can be retried or skipped but by default it is just propagated
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testWriteSkipOnError() throws Exception {
|
||||
|
||||
@@ -275,7 +275,6 @@ class FaultTolerantStepFactoryBeanRetryTests {
|
||||
* N.B. this doesn't really test retry, since the retry is only on write failures, but
|
||||
* it does test that read errors are re-presented for another try when the retryLimit
|
||||
* is high enough (it is used to build an exception handler).
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
|
||||
@@ -175,7 +175,6 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* Non-skippable (and non-fatal) exception causes failure immediately.
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@@ -1039,7 +1038,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -1049,7 +1048,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -1059,7 +1058,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
@@ -1069,7 +1068,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -1079,7 +1078,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -1089,7 +1088,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -328,9 +328,8 @@ class SimpleStepFactoryBeanTests {
|
||||
assertTrue(writeListener.trail.startsWith("1234"), "Listener order not as expected: " + writeListener.trail);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Commit interval specified is not allowed to be zero or negative.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testCommitIntervalMustBeGreaterThanZero() throws Exception {
|
||||
@@ -344,9 +343,8 @@ class SimpleStepFactoryBeanTests {
|
||||
assertThrows(IllegalStateException.class, factory::getObject);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Commit interval specified is not allowed to be zero or negative.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
void testCommitIntervalAndCompletionPolicyBothSet() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -71,7 +71,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -81,7 +81,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -91,7 +91,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: skippable < fatal; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
@@ -108,7 +108,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is unclassified
|
||||
*
|
||||
* <p>
|
||||
* expected: false; default classification
|
||||
*/
|
||||
@Test
|
||||
@@ -118,7 +118,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is skippable
|
||||
*
|
||||
* <p>
|
||||
* expected: true
|
||||
*/
|
||||
@Test
|
||||
@@ -128,7 +128,7 @@ class LimitCheckingItemSkipPolicyTests {
|
||||
|
||||
/**
|
||||
* condition: fatal < skippable; exception is fatal
|
||||
*
|
||||
* <p>
|
||||
* expected: false
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -227,9 +227,6 @@ class StepExecutorInterruptionTests {
|
||||
assertEquals(BatchStatus.FAILED, stepExecution.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
private Thread createThread(final StepExecution stepExecution) {
|
||||
Thread processingThread = new Thread(() -> {
|
||||
try {
|
||||
|
||||
@@ -838,10 +838,9 @@ class TaskletStepTests {
|
||||
assertEquals(3, stepExecution.getReadCount());
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Exception in {@link StepExecutionListener#afterStep(StepExecution)} doesn't cause
|
||||
* step failure.
|
||||
* @throws JobInterruptedException
|
||||
*/
|
||||
@Test
|
||||
void testStepFailureInAfterStepCallback() throws JobInterruptedException {
|
||||
|
||||
@@ -173,7 +173,7 @@ class ConcurrentTransactionTests {
|
||||
@Configuration
|
||||
static class DataSourceConfiguration {
|
||||
|
||||
/**
|
||||
/*
|
||||
* This datasource configuration configures the HSQLDB instance using MVCC. When
|
||||
* configured using the default behavior, transaction serialization errors are
|
||||
* thrown (default configuration example below).
|
||||
@@ -182,7 +182,6 @@ class ConcurrentTransactionTests {
|
||||
* addScript("classpath:org/springframework/batch/core/schema-drop-hsqldb.sql").
|
||||
* addScript("classpath:org/springframework/batch/core/schema-hsqldb.sql").
|
||||
* build());
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public DataSource dataSource() {
|
||||
|
||||
@@ -61,8 +61,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
/**
|
||||
* The official Docker image for SAP HANA is not publicly available. SAP HANA support is
|
||||
* tested manually. See
|
||||
* https://hub.docker.com/_/sap-hana-express-edition/plans/f2dc436a-d851-4c22-a2ba-9de07db7a9ac
|
||||
* tested manually. See <a href=
|
||||
* "https://hub.docker.com/_/sap-hana-express-edition/plans/f2dc436a-d851-4c22-a2ba-9de07db7a9ac">...</a>
|
||||
* FTR, from the previous link: "This installation does not support Docker for Windows or
|
||||
* Docker for Mac."
|
||||
*
|
||||
@@ -196,8 +196,8 @@ class HANAJobRepositoryIntegrationTests {
|
||||
/**
|
||||
* Accepts the license for the SAP HANA Express container by setting the
|
||||
* AGREE_TO_SAP_LICENSE=Y Calling this method will automatically accept the
|
||||
* license at:
|
||||
* https://www.sap.com/docs/download/cmp/2016/06/sap-hana-express-dev-agmt-and-exhibit.pdf
|
||||
* license at: <a href=
|
||||
* "https://www.sap.com/docs/download/cmp/2016/06/sap-hana-express-dev-agmt-and-exhibit.pdf">...</a>
|
||||
* @return The container itself with an environment variable accepting the SAP
|
||||
* HANA Express license
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
/**
|
||||
* Official Docker images for Oracle are not publicly available. Oracle support is tested
|
||||
* semi-manually for the moment: 1. Build a docker image for oracle/database:11.2.0.2-xe:
|
||||
* https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance#running-oracle-database-11gr2-express-edition-in-a-container
|
||||
* <a href=
|
||||
* "https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance#running-oracle-database-11gr2-express-edition-in-a-container">...</a>
|
||||
* 2. Run the test `testJobExecution`
|
||||
*
|
||||
* @author Mahmoud Ben Hassine
|
||||
|
||||
@@ -244,9 +244,6 @@ class FaultTolerantStepFactoryBeanIntegrationTests {
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* @param dataSource
|
||||
*/
|
||||
public SkipProcessorStub(DataSource dataSource) {
|
||||
jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
@@ -270,9 +270,6 @@ class FaultTolerantStepFactoryBeanRollbackIntegrationTests {
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* @param dataSource
|
||||
*/
|
||||
public SkipProcessorStub(DataSource dataSource) {
|
||||
jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
@@ -413,6 +413,14 @@
|
||||
<version>${angus-mail.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>${jsr305.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2018 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,7 @@ import org.springframework.lang.Nullable;
|
||||
* Object representing a context for an {@link ItemStream}. It is a thin wrapper for a map
|
||||
* that allows optionally for type safety on reads. It also allows for dirty checking by
|
||||
* setting a 'dirty' flag whenever any put is called.
|
||||
*
|
||||
* <p>
|
||||
* Note that putting <code>null</code> value is equivalent to removing the entry for the
|
||||
* given key.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,7 @@ public interface ItemProcessor<I, O> {
|
||||
* Process the provided item, returning a potentially modified or new item for
|
||||
* continued processing. If the returned result is {@code null}, it is assumed that
|
||||
* processing of the item should not continue.
|
||||
*
|
||||
* <p>
|
||||
* A {@code null} item will never reach this method because the only possible sources
|
||||
* are:
|
||||
* <ul>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.StringUtils;
|
||||
* Superclass for delegating classes which dynamically call a custom method of injected
|
||||
* object. Provides convenient API for dynamic method invocation shielding subclasses from
|
||||
* low-level details and exception handling.
|
||||
*
|
||||
* <p>
|
||||
* {@link Exception}s thrown by a successfully invoked delegate method are re-thrown
|
||||
* without wrapping. In case the delegate method throws a {@link Throwable} that doesn't
|
||||
* subclass {@link Exception} it will be wrapped by
|
||||
@@ -197,7 +197,7 @@ public abstract class AbstractMethodInvokingDelegator<T> implements Initializing
|
||||
* @param arguments arguments values for the { {@link #setTargetMethod(String)}. These
|
||||
* will be used only when the subclass tries to invoke the target method without
|
||||
* providing explicit argument values.
|
||||
*
|
||||
* <p>
|
||||
* If arguments are set to not-null value {@link #afterPropertiesSet()} will check the
|
||||
* values are compatible with target method's signature. In case arguments are null
|
||||
* (not set) method signature will not be checked and it is assumed correct values
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,7 +21,7 @@ import org.springframework.util.MethodInvoker;
|
||||
/**
|
||||
* Indicates an error has been encountered while trying to dynamically invoke a method
|
||||
* e.g. using {@link MethodInvoker}.
|
||||
*
|
||||
* <p>
|
||||
* The exception should be caused by a failed invocation of a method, it shouldn't be used
|
||||
* to wrap an exception thrown by successfully invoked method.
|
||||
*
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* An {@link ItemWriter} that serializes data to an {@link WritableResource} using Avro.
|
||||
*
|
||||
* <p>
|
||||
* This does not support restart on failure.
|
||||
*
|
||||
* <p>
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.Iterator;
|
||||
* A base class that handles basic reading logic based on the paginated semantics of
|
||||
* Spring Data's paginated facilities. It also handles the semantics required for
|
||||
* restartability based on those facilities.
|
||||
*
|
||||
* <p>
|
||||
* This reader is <b>not</b> thread-safe.
|
||||
*
|
||||
* @author Michael Minella
|
||||
|
||||
@@ -59,8 +59,8 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Michael Minella
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @deprecated since 5.0 in favor of the item reader from
|
||||
* https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j
|
||||
* @deprecated since 5.0 in favor of the item reader from <a href=
|
||||
* "https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j">...</a>
|
||||
*/
|
||||
@Deprecated
|
||||
public class Neo4jItemReader<T> extends AbstractPaginatedDataItemReader<T> implements InitializingBean {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,8 +40,8 @@ import org.springframework.util.CollectionUtils;
|
||||
* @author Michael Minella
|
||||
* @author Glenn Renfro
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @deprecated since 5.0 in favor of the item writer from
|
||||
* https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j
|
||||
* @deprecated since 5.0 in favor of the item writer from <a href=
|
||||
* "https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j">...</a>
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017-2021 the original author or authors.
|
||||
* Copyright 2017-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,8 +30,8 @@ import org.springframework.util.Assert;
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @since 4.0
|
||||
* @see Neo4jItemReader
|
||||
* @deprecated since 5.0 in favor of the item reader builder from
|
||||
* https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j
|
||||
* @deprecated since 5.0 in favor of the item reader builder from <a href=
|
||||
* "https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j">...</a>
|
||||
*/
|
||||
@Deprecated
|
||||
public class Neo4jItemReaderBuilder<T> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017-2021 the original author or authors.
|
||||
* Copyright 2017-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,8 +29,8 @@ import org.springframework.util.Assert;
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @since 4.0
|
||||
* @see Neo4jItemWriter
|
||||
* @deprecated since 5.0 in favor of the item writer builder from
|
||||
* https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j
|
||||
* @deprecated since 5.0 in favor of the item writer builder from <a href=
|
||||
* "https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j">...</a>
|
||||
*/
|
||||
@Deprecated
|
||||
public class Neo4jItemWriterBuilder<T> {
|
||||
|
||||
@@ -78,7 +78,7 @@ public class RepositoryItemWriterBuilder<T> {
|
||||
* {@link org.springframework.data.domain.Pageable} as the <em>last</em> argument.
|
||||
* This method can be used in place of {@link #repository(CrudRepository)},
|
||||
* {@link #methodName(String)}}.
|
||||
*
|
||||
* <p>
|
||||
* Note: The repository that is used by the repositoryMethodReference must be
|
||||
* non-final.
|
||||
* @param repositoryMethodReference of the used to get a repository and type-safe
|
||||
|
||||
@@ -345,7 +345,7 @@ public abstract class AbstractCursorItemReader<T> extends AbstractItemCountingIt
|
||||
* set this flag to true then you must wrap the DataSource in a
|
||||
* {@link ExtendedConnectionDataSourceProxy} to prevent the connection from being
|
||||
* closed and released after each commit.
|
||||
*
|
||||
* <p>
|
||||
* When you set this option to <code>true</code> then the statement used to open the
|
||||
* cursor will be created with both 'READ_ONLY' and 'HOLD_CURSORS_OVER_COMMIT'
|
||||
* options. This allows holding the cursor open over transaction start and commits
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.springframework.util.MethodInvoker;
|
||||
* Implementation of {@link SmartDataSource} that is capable of keeping a single JDBC
|
||||
* Connection which is NOT closed after each use even if {@link Connection#close()} is
|
||||
* called.
|
||||
*
|
||||
* <p>
|
||||
* The connection can be kept open over multiple transactions when used together with any
|
||||
* of Spring's {@link org.springframework.transaction.PlatformTransactionManager}
|
||||
* implementations.
|
||||
|
||||
@@ -39,7 +39,6 @@ import org.springframework.util.ClassUtils;
|
||||
* {@link #setQueryName(String)}, or a query provider strategy can be supplied via
|
||||
* {@link #setQueryProvider(HibernateQueryProvider)}.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* The reader can be configured to use either {@link StatelessSession} sufficient for
|
||||
* simple mappings without the need to cascade to associated objects or standard hibernate
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Helper methods for SQL statement parameter parsing.
|
||||
*
|
||||
* <p>
|
||||
* Only intended for internal use.
|
||||
*
|
||||
* @author Thomas Risberg
|
||||
@@ -38,7 +38,7 @@ public class JdbcParameterUtils {
|
||||
* literal, that is, surrounded by single or double quotes. This method will count
|
||||
* traditional placeholders in the form of a question mark ('?') as well as named
|
||||
* parameters indicated with a leading ':' or '&'.
|
||||
*
|
||||
* <p>
|
||||
* The code for this method is taken from an early version of the
|
||||
* {@link org.springframework.jdbc.core.namedparam.NamedParameterUtils} class. That
|
||||
* method was later removed after some refactoring, but the code is useful here for
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020-2022 the original author or authors.
|
||||
* Copyright 2020-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,7 @@ import org.springframework.util.StringUtils;
|
||||
* corresponding to the current row. The query can be set directly using
|
||||
* {@link #setQueryString(String)}, or using a query provider via
|
||||
* {@link #setQueryProvider(JpaQueryProvider)}.
|
||||
*
|
||||
* <p>
|
||||
* The implementation is <b>not</b> thread-safe.
|
||||
*
|
||||
* @author Mahmoud Ben Hassine
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,12 +32,12 @@ import org.springframework.util.Assert;
|
||||
/**
|
||||
* {@link org.springframework.batch.item.ItemWriter} that is using a JPA
|
||||
* EntityManagerFactory to merge any Entities that aren't part of the persistence context.
|
||||
*
|
||||
* <p>
|
||||
* It is required that {@link #write(Chunk)} is called inside a transaction.<br>
|
||||
*
|
||||
* The reader must be configured with an {@link jakarta.persistence.EntityManagerFactory}
|
||||
* that is capable of participating in Spring managed transactions.
|
||||
*
|
||||
* <p>
|
||||
* The writer is thread-safe after its properties are set (normal singleton behaviour), so
|
||||
* it can be used to write in multiple concurrent transactions.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -132,7 +132,7 @@ public class JdbcBatchItemWriterBuilder<T> {
|
||||
/**
|
||||
* Creates a {@link ColumnMapItemPreparedStatementSetter} to be used as your
|
||||
* {@link ItemPreparedStatementSetter}.
|
||||
*
|
||||
* <p>
|
||||
* NOTE: The item type for this {@link org.springframework.batch.item.ItemWriter} must
|
||||
* be castable to <code>Map<String,Object>></code>.
|
||||
* @return The current instance of the builder for chaining
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,13 +32,13 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* Abstract SQL Paging Query Provider to serve as a base class for all provided SQL paging
|
||||
* query providers.
|
||||
*
|
||||
* <p>
|
||||
* Any implementation must provide a way to specify the select clause, from clause and
|
||||
* optionally a where clause. In addition a way to specify a single column sort key must
|
||||
* also be provided. This sort key will be used to provide the paging functionality. It is
|
||||
* recommended that there should be an index for the sort key to provide better
|
||||
* performance.
|
||||
*
|
||||
* <p>
|
||||
* Provides properties and preparation for the mandatory "selectClause" and "fromClause"
|
||||
* as well as for the optional "whereClause". Also provides property for the mandatory
|
||||
* "sortKeys". <b>Note:</b> The columns that make up the sort key must be a true key and
|
||||
|
||||
@@ -52,7 +52,7 @@ import static org.springframework.batch.support.DatabaseType.SYBASE;
|
||||
/**
|
||||
* Default implementation of the {@link DataFieldMaxValueIncrementerFactory} interface.
|
||||
* Valid database types are given by the {@link DatabaseType} enum.
|
||||
*
|
||||
* <p>
|
||||
* Note: For MySql databases, the
|
||||
* {@link MySQLMaxValueIncrementer#setUseNewConnection(boolean)} will be set to true.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2021 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.jdbc.support.JdbcUtils;
|
||||
/**
|
||||
* Derby implementation of a {@link PagingQueryProvider} using standard SQL:2003 windowing
|
||||
* functions. These features are supported starting with Apache Derby version 10.4.1.3.
|
||||
*
|
||||
* <p>
|
||||
* As the OVER() function does not support the ORDER BY clause a sub query is instead used
|
||||
* to order the results before the ROW_NUM restriction is applied
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
|
||||
* Postgres implementation of a
|
||||
* {@link org.springframework.batch.item.database.PagingQueryProvider} using database
|
||||
* specific features.
|
||||
*
|
||||
* <p>
|
||||
* When using the groupClause, this implementation expects all select fields not used in
|
||||
* aggregate functions to be included in the groupClause (the provider does not add them
|
||||
* for you).
|
||||
|
||||
@@ -118,7 +118,7 @@ public class SqlWindowingPagingQueryProvider extends AbstractSqlPagingQueryProvi
|
||||
|
||||
/**
|
||||
* Generates ORDER BY attributes based on the sort keys.
|
||||
* @param provider
|
||||
* @param provider the paging query provider
|
||||
* @return a String that can be appended to an ORDER BY clause.
|
||||
*/
|
||||
private String buildSortClause(AbstractSqlPagingQueryProvider provider) {
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.springframework.util.ClassUtils;
|
||||
* Reads items from multiple resources sequentially - resource list is given by
|
||||
* {@link #setResources(Resource[])}, the actual reading is delegated to
|
||||
* {@link #setDelegate(ResourceAwareItemReaderItemStream)}.
|
||||
*
|
||||
* <p>
|
||||
* Input resources are ordered using {@link #setComparator(Comparator)} to make sure
|
||||
* resource ordering is preserved between job runs in restart scenario.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,7 +33,7 @@ import org.springframework.util.ClassUtils;
|
||||
* when the count of items written in current resource exceeds
|
||||
* {@link #setItemCountLimitPerResource(int)}. Suffix creation can be customized with
|
||||
* {@link #setResourceSuffixCreator(ResourceSuffixCreator)}.
|
||||
*
|
||||
* <p>
|
||||
* Note that new resources are created only at chunk boundaries i.e. the number of items
|
||||
* written into one resource is between the limit set by
|
||||
* {@link #setItemCountLimitPerResource(int)} and (limit + chunk size).
|
||||
|
||||
@@ -66,9 +66,6 @@ public class SimpleBinaryBufferedReaderFactory implements BufferedReaderFactory
|
||||
|
||||
private final String ending;
|
||||
|
||||
/**
|
||||
* @param in
|
||||
*/
|
||||
private BinaryBufferedReader(Reader in, String ending) {
|
||||
super(in);
|
||||
this.ending = ending;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user