Rule Execution Server API

ilog.rules.res.session
Class IlrPOJOSessionFactory

java.lang.Object
  extended by ilog.rules.res.session.IlrSessionFactoryBase
      extended by ilog.rules.res.session.IlrPOJOSessionFactory
All Implemented Interfaces:
IlrSessionFactory

public class IlrPOJOSessionFactory
extends ilog.rules.res.session.IlrSessionFactoryBase

Use the IlrPOJOSessionFactory class to create sessions in Java EE environments. A IlrPOJOSessionFactory object retrieves the Execution Unit (XU) connection factory from JNDI. It uses the application server configured in the XU.

Code example

The following code example shows how to set the execution mode to task execution:

   IlrSessionFactory sessionFactory = new IlrPOJOSessionFactory();
   IlrSessionRequest request = sessionFactory.createRequest();
   request.setRulesetPath(IlrPath.parsePath("/myRuleapp/myRuleset");
   request.setTaskName("myTask");
   IlrStatelessSession session = sessionFactory.createStatelessSession();
   IlrSessionResponse response = session.execute(request)
 

Since:
7.0

Constructor Summary
IlrPOJOSessionFactory()
           
 
Method Summary
 IlrManagementSession createManagementSession()
          Returns a new management session.
 IlrStatefulSession createStatefulSession(IlrPath rulesetPath, Serializable userData, Map<String,Object> initParameters, boolean forceUptodate, boolean enableInterceptor)
          Returns a stateful rule session.
 IlrStatelessSession createStatelessSession()
          Returns a stateless rule session.
 
Methods inherited from class ilog.rules.res.session.IlrSessionFactoryBase
createRequest, createStatefulSession, createTraceDAOFactory, isInterceptorEnabled, setInterceptorEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrPOJOSessionFactory

public IlrPOJOSessionFactory()
Method Detail

createStatelessSession

public IlrStatelessSession createStatelessSession()
                                           throws IlrSessionCreationException
Description copied from interface: IlrSessionFactory
Returns a stateless rule session.

Throws:
IlrSessionCreationException - if an error occurred when the stateless session was created:
Returns:
A new stateless session.

createStatefulSession

public IlrStatefulSession createStatefulSession(IlrPath rulesetPath,
                                                Serializable userData,
                                                Map<String,Object> initParameters,
                                                boolean forceUptodate,
                                                boolean enableInterceptor)
                                         throws IlrSessionCreationException
Description copied from interface: IlrSessionFactory
Returns a stateful rule session.

Throws:
IlrSessionCreationException - if an error occurred when the stateful session was created.
Parameters:
rulesetPath - The ruleset path for the session.
userData - A serializable object supplied by the user.
initParameters - Initalization parameters used by the interceptors if necessary.
forceUptodate - Set to true to indicate that the latest version of the ruleset must be used.
enableInterceptor - Set to true to indicate that the interceptors should be enabled
Returns:
A new stateful session.

createManagementSession

public IlrManagementSession createManagementSession()
                                             throws IlrSessionCreationException
Description copied from interface: IlrSessionFactory
Returns a new management session.

Throws:
IlrSessionCreationException - if an error occurs when the management session is created.
Returns:
A new management session.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2012