Getting the Provider Class for a Stateless Rule Session |
PREVIOUS NEXT |
The following tasks show you how to get the provider class from both a local and a remote client. A remote client is where the client does not run in the same JVM as the rule session. A local client is where the client runs in the same JVM as the rule session; for example, in a JSP page.
To get the provider class for a remote client:
IlrRuleSessionProvider rsProvider = new IlrRuleSessionProviderFactory.Builder(jndiProperties).build();
| Note |
The jndi.properties file depends on the application server. Following is an example for WebLogic 9.2 (found in the How to Use a Rule Session in Java EE sample).=============================== # The URL of the EJB server java.naming.provider.url=t3://localhost:7001/ # The user's name. To be uncommented when there is one # java.naming.security.principal= # The user's password. To be uncommented when there is one # java.naming.security.credentials= # The initial factory class name java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory ============================== |
To get the provider class for a local client:
You can get the provider class for a local client that does not invoke an EJB, where the client does not run in the same JVM as the rule session and does not use the session as an EJB (for example, in a JSP page).
To get the provider class for a local client that does not invoke an EJB:
IlrRuleSessionProvider rsProvider = new IlrRuleSessionProviderFactory.Builder(IlrRuleSessionProviderFactory. SIMPLE_RULESESSION_PROVIDER).build();
You can also get the provider class in a J2SE environment (where the rule sessions are not used in an application server context).
To get the provider class in a J2SE environment:
// It will print the XU logs on System.err PrintWriter loggerPrinter = new PrintWriter(System.err); IlrRuleSessionProvider rsProvider = new IlrRuleSessionProviderFactory.Builder(IlrRuleSessionProviderFactory. J2SE_RULESESSION_PROVIDER).setLogger(loggerPrinter).build();
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |