Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 48 additions & 37 deletions src/site/markdown/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,57 @@ specific language governing permissions and limitations
under the License.
-->
# Configuration
## batchee.properties
#### batchee.properties
A batchee.properties file can be created to configure the JBatch container.
Since it will be looked up in the classloader, the advice is to place it inside the container loader.
For Maven projects, this means the file can be created inside the resources folder.

`batchee.properties` can configure the JBatch container. It will look up in the classloader (advise: put it in container loader).
## Configurable Services
To override a service implementation just set the key name (from the list below) to a qualified name.
For instance to use shiro security service create a batchee.properties with:

Here are the available configurable services:
<code>SecurityService = org.apache.batchee.shiro.ShiroSecurityService</code>

* TransactionManagementService
* transaction.user-transaction.jndi: when using default TransactionManagementService override the default UserTransaction jndi name
* PersistenceManagerService (service) - here are referenced default implementations configuration. They are exclusive.
* persistence.database.has-schema: if the database needs to use a schema or not
* persistence.database.schema: schema to use for persistence when using JDBC
* persistence.database.jndi: jndi name of the datasource to use for persistence when using JDBC default implementation
* persistence.database.driver: jdbc driver to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.url: jdbc url to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.user: jdbc user to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.password: jdbc password to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.tables.checkpoint: checkpoints table name
* persistence.database.tables.job-instance: job instances table name
* persistence.database.tables.job-execution: job executions table name
* persistence.database.tables.step-execution: step executions table name
* persistence.database.db-dictionary: the `org.apache.batchee.container.services.persistence.jdbc.database.Database` class to use
* persistence.database.ddl: `create` to create the database if it doesn't exist
* persistence.memory.global: storing statically data when using in memory persistence
* persistence.memory.max-jobs-instances: number of job instance data to store, default to 1000, -1 means keep all in memory
* persistence.jpa.entity-manager-provider: in case of `org.apache.batchee.container.services.persistence.JPAPersistenceService` the `org.apache.batchee.container.services.persistence.jpa.EntityManagerProvider` qualified name
* persistence.jpa.transaction-provider: for JPA persistence service the `org.apache.batchee.container.services.persistence.jpa.TransactionProvider` qualified name
* persistence.jpa.unit-name: for JPA persistence service the unit name (default `batchee`)
* persistence.jpa.property..*: for JPA persistence service the persistence-unit properties
* JobStatusManagerService
* BatchThreadPoolService

* BatchArtifactFactory
* BatchKernelService
* BatchThreadPoolService
* JobStatusManagerService
* JobXMLLoaderService
* BatchArtifactFactory
* PersistenceManagerService
* Provided Implementations:
* `org.apache.batchee.container.services.persistence.MemoryPersistenceManagerService` (default)
* `org.apache.batchee.container.services.persistence.JDBCPersistenceManagerService`
* `org.apache.batchee.container.services.persistence.JPAPersistenceManagerService`
* Persistence Properties:
* persistence.database.has-schema: if the database needs to use a schema or not
* persistence.database.schema: schema to use for persistence when using JDBC
* persistence.database.jndi: jndi name of the datasource to use for persistence when using JDBC default implementation
* persistence.database.driver: jdbc driver to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.url: jdbc url to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.user: jdbc user to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.password: jdbc password to use for persistence when using JDBC default implementation if no jndi name is provided
* persistence.database.tables.checkpoint: checkpoints table name
* persistence.database.tables.job-instance: job instances table name
* persistence.database.tables.job-execution: job executions table name
* persistence.database.tables.step-execution: step executions table name
* persistence.database.db-dictionary: the `org.apache.batchee.container.services.persistence.jdbc.database.Database` class to use
* persistence.database.ddl: `create` to create the database if it doesn't exist
* persistence.memory.global: storing statically data when using in memory persistence
* persistence.memory.max-jobs-instances: number of job instance data to store, default to 1000, -1 means keep all in memory
* persistence.jpa.entity-manager-provider: in case of `org.apache.batchee.container.services.persistence.JPAPersistenceService` the `org.apache.batchee.container.services.persistence.jpa.EntityManagerProvider` qualified name
* persistence.jpa.transaction-provider: for JPA persistence service the `org.apache.batchee.container.services.persistence.jpa.TransactionProvider` qualified name
* persistence.jpa.unit-name: for JPA persistence service the unit name (default `batchee`)
* persistence.jpa.property..*: for JPA persistence service the persistence-unit properties
* SecurityService
* TransactionManagementService
* transaction.user-transaction.jndi: when using default TransactionManagementService override the default UserTransaction jndi name


Note about JPA persistence service: to stay portable entities are not enhanced. Therefore you need to use a javaagent to do so.

To override a service implementation just set the key name (from the previous list) to a qualified name.
For instance to use shiro security service create a batchee.properties with:

<pre class="prettyprint linenums"><![CDATA[
SecurityService = org.apache.batchee.shiro.ShiroSecurityService]]></pre>

Some more configuration is available in batchee.properties:
Note about JPA persistence service: to stay portable entities are not enhanced.
Therefore you need to use a javaagent to do so.

#### Additional Properties
* `org.apache.batchee.jmx`: a boolean activating (by default) or not the JMX facade for the `JobOperator`
* `org.apache.batchee.jmx.application`: a name to distinguish job operator between applications when batchee is not shared (will be shown in JMX name)
* `org.apache.batchee.init.verbose`: boolean activating BatchEE logo print at startup
Expand All @@ -70,3 +76,8 @@ Some more configuration is available in batchee.properties:
* `org.apache.batchee.step.listeners.after`: global step listener references executed after all others
* `org.apache.batchee.job.listeners.before`: global job listener references executed before all others
* `org.apache.batchee.job.listeners.after`: global job listener references executed after all others

## Database Support
Batchee uses an embedded Apache Derby database by default.
Other databases can be configured by setting the persistence.database.db-dictionary property,
and switching to the JDBC or JPA PersistenceManagerService implementation.