public class BatchFraction extends org.wildfly.swarm.config.BatchJBeret<BatchFraction> implements org.wildfly.swarm.spi.api.Fraction<BatchFraction>
org.wildfly.swarm.config.BatchJBeret.BatchJBeretResourcesAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 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() |
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(org.wildfly.swarm.config.batch.jberet.InMemoryJobRepository<?> jobRepository)
Adds the in-memory job repository as the default job repository.
|
BatchFraction |
defaultJobRepository(org.wildfly.swarm.config.batch.jberet.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, subresources, threadFactories, threadFactory, threadFactory, threadFactory, threadFactory, threadPool, threadPool, threadPool, threadPool, threadPoolsclear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringpublic 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()
applyDefaults in interface org.wildfly.swarm.spi.api.Fraction<BatchFraction>public BatchFraction defaultJobRepository(org.wildfly.swarm.config.batch.jberet.InMemoryJobRepository<?> jobRepository)
jobRepository - the job repository to use as the defaultpublic BatchFraction defaultJobRepository(org.wildfly.swarm.config.batch.jberet.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 © 2017 JBoss by Red Hat. All rights reserved.