Execution Unit Notifications with the Management Session Bean |
PREVIOUS NEXT |
To notify an Execution Unit (XU) running in a local JVM cache that a ruleset is invalid, you must use directly a session bean named IlrManagementSession. This session bean has the same provider as the JRules rule sessions and safeguards the user from the Common Client Interface (CCI) connection of the XU.
The IlrManagementSession has a method named invalidate that notifies the XU that a ruleset path, or namespace, is no longer valid. IlrManagementSession provides a second invalidate method that takes an array of ruleset names: public void invalidate(java.lang.String[] rulesetPaths). This method can be used to invalidate an array of rulesets. Note, calling a ruleset after it has been invalidated initiates a read on the persistence layer.
The ruleset paths taken by these methods are canonical. To retrieve the canonical ruleset path, use the solveRulesetPath method.
In a J2EE cluster, the notification of a newly deployed ruleset to every XU on the cluster is reliable using either the Rule Execution Server Console or the res-deploy ant task. The XU can then be relied upon to execute the new version of a ruleset.
In J2SE, or when the ant tasks res-write-db and res-write-file are used, there is no notification of an update sent to the XU (not even in J2EE). For this reason, an API is provided to notify a local XU of a ruleset update.
| Note |
| This API is not cluster-aware. The API will only notify an XU deployed on the same VM or server. |
This API has two implementations:
The following code shows how to perform this notification:
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |