public interface IlrSessionInterceptor
IlrSessionInterceptor represents the interface of rule-session execution
interceptors.
Interceptors transparently influence ruleset path selection.
Using interceptors, you can inject custom behaviors before and after ruleset execution.
Use this interface to intercept both stateless and stateful rule sessions. The only difference lies in the way the methods are called:
transformRsPath
and beforeExecute methods are triggered before the ruleset
is executed. The afterExecute method is triggered after the ruleset is executed.
transformRsPath method is called only once
when the stateful session is created. The ruleset path is immutable
inside a stateful session. The beforeExecute and
afterExecute methods are called before and after each
ruleset execution inside the same stateful session.
| Modifier and Type | Method and Description |
|---|---|
void |
afterExecute(IlrInterceptorContext context)
Called after ruleset execution.
|
void |
beforeExecute(IlrInterceptorContext context)
Called before ruleset execution.
|
IlrPath |
transformRsPath(IlrPath path,
IlrRuleAppInformation ruleAppInformation,
java.io.Serializable userData,
java.util.Map<java.lang.String,java.lang.Object> parameters,
IlrSessionFactory sessionFactory)
Used for interceptor-based ruleset selection.
|
IlrPath transformRsPath(IlrPath path, IlrRuleAppInformation ruleAppInformation, java.io.Serializable userData, java.util.Map<java.lang.String,java.lang.Object> parameters, IlrSessionFactory sessionFactory) throws IlrSessionInterceptorException
beforeExecute method.
In stateful sessions, it is called only once when the session is created.An - IlrSessionInterceptorException object stops the ruleset execution
process when thrown in implementations of this class.IlrSessionInterceptorExceptionpath - The initial ruleset path. This path is supplied when a
stateless session is executed or a stateful session is initialized.ruleAppInformation - The RuleApp information.userData - Arbitrary user data. This data comes from:
parameters - Arbitrary parameters. This data comes from:
sessionFactory - The session factory used to create the session
that fired the interceptor.void beforeExecute(IlrInterceptorContext context) throws IlrSessionInterceptorException
transformRsPath method when the interceptor needs to change
the ruleset path before execution. The transformRsPath method
has a consistent behavior for stateful and stateless rule sessions.An - IlrSessionInterceptorException object stops the ruleset execution
process when thrown in implementations of this class.IlrSessionInterceptorExceptioncontext - The interceptor context. No response is set at this time.void afterExecute(IlrInterceptorContext context) throws IlrSessionInterceptorException
An - IlrSessionInterceptorException object can be thrown by implementations
of this class.IlrSessionInterceptorExceptioncontext - The interceptor context.© Copyright IBM Corp. 1987, 2017