Reference bindings for Rule Execution Server modules

You use the Java™ Naming and Directory Interface (JNDI) to organize and locate components in a distributed computing environment.

Rule Execution Server execution components are packaged in archives. You use a JNDI name to bind the execution unit (XU) inside an archive for the EJB rule sessions or inside any deployment descriptors that are used by the component that calls the simple Java rule session implementation. When you use reference bindings for Rule Execution Server modules, it is best if you keep the default JNDI name.

Execution components are packaged in the following archives:
  • <InstallDir>/executionserver/lib/jrules-res-session-java.jar
  • <InstallDir>/executionserver/<appserver>/jrules-res-session-ejb3-<appserver>.jar
  • <InstallDir>/executionserver/applicationservers/<appserver>/jrules-res-mdb-<appserver>.jar

The following figure shows the reference bindings for the Rule Execution Server modules.

Reference bindings for the Rule Execution Server modules
You can use any JNDI name that you want. However, if you use the default JNDI name eis/XUConnectionFactory, JNDI automatically binds the execution unit (XU) inside the ejb-jar.xml file. This is true for the EJB rule sessions and for any deployment descriptors that are used by the component that calls the simple Java rule session implementation. Conversely, if you choose a different JNDI name, you must specify it in the code of a POJO rule session, or in the descriptor of the EJB rule session.
Note:

Most application servers offer ways to remap the bindings. At deployment time, you can remap the bindings that are described here with specific deployment descriptors, deployment scripts, or with the console of your application server. Consequently, you can link the declared JNDI reference to real JNDI names that you define at deployment time.

When two identical EJBs are deployed in two different EARs, you must define different real JNDI names for these EJBs, or let the application server define such names. For example:
  1. You can modify any descriptor as follows:
    myService/ejb/IlrStatefulRuleSessionEJB
  2. In the properties file that is used to create the initial context, define this property as follows:
    naming.provider.url=t3://localhost:7001/myService

You can then use the factory class for different JNDI names.