The Open For Business Project SourceForge Logo

The Open For Business Project: Service Engine Configuration Guide

Written By: Andy Zeneski, [email protected]
Minor changes/corrections by: Pawel H. Debski and David E. Jones
Last Updated: January 28, 2003

Table of Contents


Related Documents:



Introduction


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.


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 Name Required? Description
ttlY The time to live for each invoker thread. Once this time is reached the thread is destroyed.
wait-millisY Each invoker thread will sleep for this amount of time before checking for jobs to run.
jobsY The maximum number of jobs each invoker thread will run before being destroyed.
min-threadsY The minimum number of invoker threads to keep around.
max-threadsY The maximum number of invoker thread to create.
poll-enabledY When 'true' the scheduler will poll the database for scheduled jobs.
poll-db-millisY If 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 Name Required? Description
nameY The name of the service engine. This must be unique.
classY The 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 Name Required? Description
nameY The name of the resource loader. Used in other tags in the 'loader' attribute.
classY 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-envN The name of a Java environment property to put at the very beginning of the full location, before the prefix. This is optional.
prefixN 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.

Global Services


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
loaderY The loader referenced from the resource loader definitions.
locationY Specifies 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 Name Required? Description
loaderY The loader referenced from the resource loader definitions.
locationY Specifies 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 Name Required? Description
loaderY The loader referenced from the resource loader definitions.
locationY Specifies 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 Name Required? Description
nameY The name of the JMS service, used as the location in service definitions.
send-modeY 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-nameY The name of the JNDI server defined in the jndiservers.xml.
jndi-nameY The name in JNDI for the JMS Factory.
topic-queueY The name of the topic or queue.
typeY The JMS type can be either topic or queue.
usernameY user name used to connect to the topic/queue.
passwordY password used to connect to the topic/queue.
listenY 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.