public class BatchFraction extends BatchJBeret<BatchFraction> implements Fraction<BatchFraction>
BatchJBeret.BatchJBeretResources
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_JOB_REPOSITORY_NAME |
static String |
DEFAULT_THREAD_POOL_NAME |
Constructor and Description |
---|
BatchFraction() |
Modifier and Type | Method and Description |
---|---|
BatchFraction |
applyDefaults()
Apply whatever defaults are required.
|
static BatchFraction |
createDefaultFraction()
Creates a default batch fraction.
|
BatchFraction |
defaultJobRepository(DatasourcesFraction datasource)
Adds a new JDBC job repository using the datasource name as the job repository name and sets it as the default job
repository.
|
BatchFraction |
defaultJobRepository(InMemoryJobRepository<?> jobRepository)
Adds the in-memory job repository as the default job repository.
|
BatchFraction |
defaultJobRepository(JDBCJobRepository<?> jobRepository)
Adds the JDBC job repository as the default job repository.
|
BatchFraction |
defaultJobRepository(String name,
DatasourcesFraction datasource)
Adds a new JDBC job repository and sets it as the default job repository.
|
BatchFraction |
defaultThreadPool(int maxThreads,
int keepAliveTime,
TimeUnit keepAliveUnits)
Creates a new thread-pool using the default name.
|
BatchFraction |
defaultThreadPool(String name,
int maxThreads,
int keepAliveTime,
TimeUnit keepAliveUnits)
Creates a new thread-pool and sets the created thread-pool as the default thread-pool for batch jobs.
|
BatchFraction |
jdbcJobRepository(DatasourcesFraction datasource)
Creates a new JDBC job repository using the name of the datasource for the job repository name.
|
BatchFraction |
jdbcJobRepository(String name,
DatasourcesFraction datasource)
Creates a new JDBC job repository.
|
void |
postConstruct() |
BatchFraction |
threadPool(int maxThreads,
int keepAliveTime,
TimeUnit keepAliveUnits)
Creates a new thread-pool using the default name that can be used for batch jobs.
|
BatchFraction |
threadPool(String name,
int maxThreads,
int keepAliveTime,
TimeUnit keepAliveUnits)
Creates a new thread-pool that can be used for batch jobs.
|
addPropertyChangeListener, defaultJobRepository, defaultJobRepository, defaultThreadPool, defaultThreadPool, getKey, inMemoryJobRepositories, inMemoryJobRepository, inMemoryJobRepository, inMemoryJobRepository, inMemoryJobRepository, jdbcJobRepositories, jdbcJobRepository, jdbcJobRepository, jdbcJobRepository, jdbcJobRepository, removePropertyChangeListener, restartJobsOnResume, restartJobsOnResume, securityDomain, securityDomain, subresources, threadFactories, threadFactory, threadFactory, threadFactory, threadFactory, threadPool, threadPool, threadPool, threadPool, threadPools
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyDefaults
public static final String DEFAULT_JOB_REPOSITORY_NAME
public static final String DEFAULT_THREAD_POOL_NAME
@PostConstruct public void postConstruct()
public static BatchFraction createDefaultFraction()
Uses an in-memory
job repository with the default name.
Uses a default thread-pool with a calculated maximum number of threads based on the available number of processors. A keep alive time of 30 seconds is used for the thread-pool.
public BatchFraction applyDefaults()
Fraction
applyDefaults
in interface Fraction<BatchFraction>
Fraction.applyDefaults(boolean)
public BatchFraction defaultJobRepository(InMemoryJobRepository<?> jobRepository)
jobRepository
- the job repository to use as the defaultpublic BatchFraction defaultJobRepository(JDBCJobRepository<?> jobRepository)
jobRepository
- the job repository to use as the defaultpublic BatchFraction defaultJobRepository(DatasourcesFraction datasource)
datasource
- the datasource to use to connect to the databasepublic BatchFraction defaultJobRepository(String name, DatasourcesFraction datasource)
name
- the name for the JDBC job repositorydatasource
- the datasource to use to connect to the databasepublic BatchFraction jdbcJobRepository(DatasourcesFraction datasource)
datasource
- the datasource to use to connect to the databasepublic BatchFraction jdbcJobRepository(String name, DatasourcesFraction datasource)
name
- the name for the job repositorydatasource
- the datasource to use to connect to the databasepublic BatchFraction defaultThreadPool(int maxThreads, int keepAliveTime, TimeUnit keepAliveUnits)
maxThreads
- the maximum number of threads to set the pool tokeepAliveTime
- the time to keep threads alivekeepAliveUnits
- the time unit for the keep alive timepublic BatchFraction defaultThreadPool(String name, int maxThreads, int keepAliveTime, TimeUnit keepAliveUnits)
name
- the maximum number of threads to set the pool tokeepAliveTime
- the time to keep threads alivekeepAliveUnits
- the time unit for the keep alive timepublic BatchFraction threadPool(int maxThreads, int keepAliveTime, TimeUnit keepAliveUnits)
keepAliveTime
- the time to keep threads alivekeepAliveUnits
- the time unit for the keep alive timepublic BatchFraction threadPool(String name, int maxThreads, int keepAliveTime, TimeUnit keepAliveUnits)
name
- the maximum number of threads to set the pool tokeepAliveTime
- the time to keep threads alivekeepAliveUnits
- the time unit for the keep alive timeCopyright © 2019 JBoss by Red Hat. All rights reserved.