This document describes the configuration of the Service Engine. It starts
with an introduction to general ideas and then goes through each part of the
serviceengine.xml file and explains the available elements and their
usage. The serviceengine.xml file used for the OFBiz applications has
examples of a number of different options and is located in ofbiz/commonapp/etc/serviceengine.xml
.
The configuration of the Service Engine is done through a simple XML
file called serviceengine.xml
that must exist somewhere on the classpath.
The authorization
tag is used to configure the service called for
service authentication. This tag has a single required attribute service-name
; the value
of this attribute should be the name of the service to use for authorization. By default this
is defined to use the general OFBiz userLogin
service.
The job scheduler is used for asynchronous and scheduled jobs/services. It contains a poller
thread and several invoker threads. The thread-pool
tag is used to configure
how each thread operates. The following attributes are available:
Attribute Name | Required? | Description |
ttl | Y | The time to live for each invoker thread. Once this time is reached the thread is destroyed. |
wait-millis | Y | Each invoker thread will sleep for this amount of time before checking for jobs to run. |
jobs | Y | The maximum number of jobs each invoker thread will run before being destroyed. |
min-threads | Y | The minimum number of invoker threads to keep around. |
max-threads | Y | The maximum number of invoker thread to create. |
poll-enabled | Y | When 'true' the scheduler will poll the database for scheduled jobs. |
poll-db-millis | Y | If polling is enabled this defined how often the poller thread runs. |
Each implementation of the GenericEngine
interface needs to be defined in order to
be used in the service definitions. The engine
has the following attributes:
Attribute Name | Required? | Description |
name | Y | The name of the service engine. This must be unique. |
class | Y | The class which implements GenericEngine |
The resource-loader
tag is used to configure a named resource loader
that can be used elsewhere to load XML and other resources. It has the following
attributes.
Attribute Name | Required? | Description |
name | Y | The name of the resource loader. Used in other tags in the 'loader' attribute. |
class | Y | The class to use that extends the abstract class org.ofbiz.core.service.config.ResourceLoader. Available classes include FileLoader, UrlLoader, and ClasspathLoader, all in the same package as the ResourceLoader class. |
prepend-env | N | The name of a Java environment property to put at the very beginning of the full location, before the prefix. This is optional. |
prefix | N | A string to put before the location when making the full location. This is optional. If used will go after the prepended environment property and before the location specified for each resource. |
The global-services
tag is used to define the location of service definition files.
This tag has the following two attributes:
Attribute Name | Required? | Description |
loader | Y | The loader referenced from the resource loader definitions. |
location | Y | Specifies the location that the resource-loader will use inside itself to load the resource. |
The service-groups
tag is used to define the location of the service group
definition files. This tag has the following two attributes:
Attribute Name | Required? | Description |
loader | Y | The loader referenced from the resource loader definitions. |
location | Y | Specifies the location that the resource-loader will use inside itself to load the resource. |
This service-ecas
tag is used to define the location of the service event condition
action definition files. This tag has the following two attributes:
Attribute Name | Required? | Description |
loader | Y | The loader referenced from the resource loader definitions. |
location | Y | Specifies the location that the resource-loader will use inside itself to load the resource. |
The tag jms-service
defines service locations for JMS services.
Attribute Name | Required? | Description |
name | Y | The name of the JMS service, used as the location in service definitions. |
send-mode | Y | The mode which to send the defined servers (below) can be:
none, all, first-available, random, round-robin, or least-load . |
The jms-service
tag includes one or more server
tags
that contain the following attributes:
Attribute Name | Required? | Description |
jndi-server-name | Y | The name of the JNDI server defined in the jndiservers.xml. |
jndi-name | Y | The name in JNDI for the JMS Factory. |
topic-queue | Y | The name of the topic or queue. |
type | Y | The JMS type can be either topic or queue . |
username | Y | user name used to connect to the topic/queue. |
password | Y | password used to connect to the topic/queue. |
listen | Y | true/false to enable listening on this queue/topic. |
The jndi-server definition in the jndiservers.xml file should point to where the JMS client APIs can
be located. This will be used to get either a TopicConnectionFactory or a QueueConnectionFactory depending
on the type
that is defined. The jndi-name should point to the name of the object in JNDI
that contains this connection factory instance.