Class TransactionLockInterceptor

  • All Implemented Interfaces:
    org.drools.core.runtime.ChainableRunner, org.drools.core.runtime.InternalLocalRunner, org.kie.api.runtime.CommandExecutor, org.kie.api.runtime.ExecutableRunner<org.kie.api.runtime.RequestContext>

    public class TransactionLockInterceptor
    extends org.drools.core.command.impl.AbstractInterceptor
    ExecutableInterceptor that will lock underlying Runner until transaction completion. In case there is no transaction active lock is released directly. By default, interceptor is disabled and needs to be explicitly enabled in one of two ways:
    • using system property named org.kie.tx.lock.enabled that must be set to true
    • using environment entry named TRANSACTION_LOCK_ENABLED that must be set to true
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.drools.core.runtime.InternalLocalRunner

        org.drools.core.runtime.InternalLocalRunner.SingleBatchExecutable, org.drools.core.runtime.InternalLocalRunner.SingleCommandExecutable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doRelease()  
      org.kie.api.runtime.RequestContext execute​(org.kie.api.runtime.Executable executable, org.kie.api.runtime.RequestContext ctx)  
      protected void release​(TransactionManager txm)  
      protected void releaseAfterFailure()  
      • Methods inherited from class org.drools.core.command.impl.AbstractInterceptor

        executeNext, getNext, setNext
      • Methods inherited from class org.drools.core.fluent.impl.PseudoClockRunner

        createContext
      • Methods inherited from interface org.kie.api.runtime.ExecutableRunner

        createContext
      • Methods inherited from interface org.drools.core.runtime.InternalLocalRunner

        execute, execute, execute
    • Constructor Detail

      • TransactionLockInterceptor

        public TransactionLockInterceptor​(org.kie.api.runtime.Environment environment)
      • TransactionLockInterceptor

        public TransactionLockInterceptor​(org.kie.api.runtime.Environment environment,
                                          String releaseTxKey)
    • Method Detail

      • execute

        public org.kie.api.runtime.RequestContext execute​(org.kie.api.runtime.Executable executable,
                                                          org.kie.api.runtime.RequestContext ctx)
        Specified by:
        execute in interface org.kie.api.runtime.ExecutableRunner<org.kie.api.runtime.RequestContext>
        Overrides:
        execute in class org.drools.core.fluent.impl.PseudoClockRunner
      • releaseAfterFailure

        protected void releaseAfterFailure()
      • doRelease

        protected void doRelease()