Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

Written by: Andy Zeneski
Edited by: Les Austin, Pawel H Debski and David E. Jones
 
Table of Contents

Related Documents

 

  • XML File Definitions (Documents Page)

Introduction


This document describes the configuration of the Service Engine. It starts with an introduction of 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.

Authorization


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.

Thread Pool


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 NameRequired?Description
ttlYThe time to live for each invoker thread. Once this time is reached the thread is destroyed.
wait-millisYEach invoker thread will sleep for this amount of time before checking for jobs to run.
jobsYThe maximum number of jobs each invoker thread will run before being destroyed.
min-threadsYThe minimum number of invoker threads to keep around.
max-threadsYThe maximum number of invoker threads to create.
poll-enabledYWhen 'true' the scheduler will poll the database for scheduled jobs.
poll-db-millisYIf polling is enabled this defined how often the poller thread runs.

Engine Definitions


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 NameRequired?Description
nameYThe name of the service engine. This must be unique.
classYThe class which implements GenericEngine

Resource Loaders


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 NameRequired?Description
nameYThe name of the resource loader. Used in other tags in the 'loader' attribute.
classYThe class to use that extends the abstract class org.ofbiz.service.config.ResourceLoader. Available classes include FileLoader, UrlLoader, and ClasspathLoader, all in the same package as the ResourceLoader class.
prepend-envNThe name of a Java environment property to put at the very beginning of the full location, before the prefix. This is optional.
prefixNA 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.

Global Services


The global-services tag is used to define the location of service definition files. This tag has the following two attributes:

Attribute NameRequired?Description
loaderYThe loader referenced from the resource loader definitions.
locationYSpecifies the location that the resource-loader will use inside itself to load the resource.

Service Groups


The service-groups tag is used to define the location of the service group definition files. This tag has the following two attributes:

Attribute NameRequired?Description
loaderYThe loader referenced from the resource loader definitions.
locationYSpecifies the location that the resource-loader will use inside itself to load the resource.

ECAs


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 NameRequired?Description
loaderYThe loader referenced from the resource loader definitions.
locationYSpecifies the location that the resource-loader will use inside itself to load the resource.

JMS


The tag jms-service defines service locations for JMS services.

Attribute NameRequired?Description
nameYThe name of the JMS service, used as the location in service definitions.
send-modeYThe 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 NameRequired?Description
jndi-server-nameYThe name of the JNDI server defined in the jndiservers.xml.
jndi-nameYThe name in JNDI for the JMS Factory.
topic-queueYThe name of the topic or queue.
typeYThe JMS type can be either topic or queue.
usernameYuser name used to connect to the topic/queue.
passwordYpassword used to connect to the topic/queue.
listenYtrue/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.

  • No labels