public class JsrJobParametersConverter extends java.lang.Object implements JobParametersConverter, org.springframework.beans.factory.InitializingBean
Modifier and Type | Field and Description |
---|---|
javax.sql.DataSource |
dataSource |
org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer |
incrementer |
static java.lang.String |
JOB_RUN_ID |
java.lang.String |
tablePrefix |
Constructor and Description |
---|
JsrJobParametersConverter(javax.sql.DataSource dataSource)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
JobParameters |
getJobParameters(java.util.Properties properties)
Get a new
JobParameters instance. |
java.util.Properties |
getProperties(JobParameters params)
The inverse operation: get a
Properties instance. |
void |
setTablePrefix(java.lang.String tablePrefix)
The table prefix used in the current
JobRepository |
public static final java.lang.String JOB_RUN_ID
public org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer incrementer
public java.lang.String tablePrefix
public javax.sql.DataSource dataSource
public JsrJobParametersConverter(javax.sql.DataSource dataSource)
dataSource
- used to gain access to the database to get unique ids.public void setTablePrefix(java.lang.String tablePrefix)
JobRepository
tablePrefix
- the table prefix used for the job repository tablespublic void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public JobParameters getJobParameters(@Nullable java.util.Properties properties)
JobParametersConverter
JobParameters
instance. If given null, or an empty
properties, an empty JobParameters will be returned.getJobParameters
in interface JobParametersConverter
properties
- the runtime parameters in the form of String literals.JobParameters
properties converted to the correct
types.public java.util.Properties getProperties(@Nullable JobParameters params)
JobParametersConverter
Properties
instance. If given null
or empty JobParameters, an empty Properties should be returned.getProperties
in interface JobParametersConverter
params
- the JobParameters
instance to be converted.