The execution unit (XU) is a resource adapter for Java™ EE Connector Architecture (JCA) 1.5. The XU handles the low-level aspects of ruleset execution and collaborates with the server to manage resources.
The XU communicates with the rule engines and collaborates with the resource adapter container. It manages resources through services such as work management, connection management, lifecycle management, and resource adapter configuration.
When the XU is deployed as a Java EE resource adapter in an application server, the resources are managed by the application server.
When a Java SE rule session is used, the XU manages the resources by itself, and uses its own resource adapter container.
The application server or application client invokes the XU to execute rulesets with either the classic rule engine or the decision engine.
Rulesets for use with the classic rule engine and rulesets for use with the decision engine can share a single XU instance for their execution.
The XU collaborates with the resource adapter container to manage resources.
A transaction is a set of operations that must be either committed all together or not committed at all to maintain data consistency and integrity.
The XU does not provide transaction management itself. However, it does not prevent the execution of a ruleset from registering a transaction resource into the transaction scope. Typically, database operations that are triggered by the execution of a ruleset can use transactions even if the XU does not support transactions.
The XU is a stand-alone deployable unit that is packaged as a resource adapter archive file (RAR) for all supported Java EE application servers. You can embed the XU RAR file into an EAR file, like any Java EE connector.
The XU retrieves rulesets and provides scalability.
You can modify the behavior of the XU by changing its configuration properties.
For Java EE sessions, the configuration properties of the XU are defined in the META-INF/ra.xml file of the .RAR artifact.
For Java SE sessions, you can change the configuration properties of the XU by API or by adding a configuration file in the application class path. Pass the XU configuration during the initialization of the session factory. You cannot change the configuration of the XU after the factory is initialized.
All cache entries are linked to the JCA pool. All the XU resources are managed indirectly by the application server. Each rule engine is linked to an Service Provider Interface (SPI) connection, which is cached by the application server in the JCA pool. A ruleset is shared and kept in memory until no JCA connection references it. At the end of an execution session, the server can put the SPI connection back into the JCA pool. In this case, the associated rule engine is reset and ready for another execution.