ilog.rules.res.session
Class IlrJ2SESessionFactory
- java.lang.Object
-
- ilog.rules.res.session.impl.IlrSessionFactoryBase
-
- ilog.rules.res.session.IlrJ2SESessionFactory
-
- All Implemented Interfaces:
- IlrSessionFactory
public class IlrJ2SESessionFactory extends ilog.rules.res.session.impl.IlrSessionFactoryBase
TheIlrJ2SESessionFactory
class is a rule session factory for Java SE environments. This class is a wrapper for a fully functional Java SE Execution Unit (XU). It does not depend on application server resources.Code example
See
IlrSessionFactory
for a code example that shows how to execute rules in a Java SE session.- Since:
- 7.0
-
-
Constructor Summary
Constructors Constructor and Description IlrJ2SESessionFactory()
Creates a session factory.IlrJ2SESessionFactory(IlrSessionFactoryConfig config)
Creates a session factory with a custom configuration.IlrJ2SESessionFactory(java.io.PrintWriter logWriter)
Creates a session factory.
-
Method Summary
Methods Modifier and Type Method and Description static IlrSessionFactoryConfig
createDefaultConfig()
Creates a session factory configuration that holds default settings.IlrManagementSession
createManagementSession()
Returns a new management session.IlrStatefulSession
createStatefulSession(IlrPath rulesetPath, java.io.Serializable userData, java.util.Map<java.lang.String,java.lang.Object> initParameters, boolean forceUptodate, boolean enableInterceptor)
Returns a stateful rule session.IlrStatelessSession
createStatelessSession()
Returns a stateless rule session.protected java.io.InputStream
findXUDescriptorStream()
void
release()
Releases the resources that are used by this session factory.
After this method has been called, any rule session that is created by this factory and still in use may have an unpredictable behaviour.
Call this method only if you no longer want to execute rule sessions and need to release the corresponding resources.
-
-
-
Constructor Detail
-
IlrJ2SESessionFactory
public IlrJ2SESessionFactory()
Creates a session factory.
-
IlrJ2SESessionFactory
public IlrJ2SESessionFactory(java.io.PrintWriter logWriter)
Creates a session factory.- Since:
- 8.6
- Parameters:
logWriter
- The XU log messages will be written to this stream.
-
IlrJ2SESessionFactory
public IlrJ2SESessionFactory(IlrSessionFactoryConfig config)
Creates a session factory with a custom configuration. UsecreateDefaultConfig()
to create a session factory configuration.- Parameters:
config
- a session factory configuration
-
-
Method Detail
-
createDefaultConfig
public static IlrSessionFactoryConfig createDefaultConfig()
Creates a session factory configuration that holds default settings. Use this method in conjunction withIlrJ2SESessionFactory(IlrSessionFactoryConfig)
to create a custom session factory.- Since:
- 8.0
- Returns:
- a session factory configuration that holds default settings
-
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, java.io.Serializable userData, java.util.Map<java.lang.String,java.lang.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
- Initialization parameters used by the interceptors if necessary.forceUptodate
- Set totrue
to indicate that the latest version of the ruleset must be used.enableInterceptor
- Set totrue
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.
-
findXUDescriptorStream
protected java.io.InputStream findXUDescriptorStream()
-
release
public void release() throws java.lang.IllegalStateException
Releases the resources that are used by this session factory.
After this method has been called, any rule session that is created by this factory and still in use may have an unpredictable behaviour.
Call this method only if you no longer want to execute rule sessions and need to release the corresponding resources.- Throws:
java.lang.IllegalStateException
-
-