public void startBatchExecution(ExecutionResultImpl results) { this.ruleBase.readLock(); this.lock.lock(); this.batchExecutionResult = results; }
public void setGlobal(final String identifier, final Object value) { // Cannot set null values if ( value == null ) { return; } try { this.ruleBase.readLock(); startOperation(); // Make sure the global has been declared in the RuleBase final Map globalDefintions = this.ruleBase.getGlobals(); final Class type = (Class) globalDefintions.get( identifier ); if ( (type == null) ) { throw new RuntimeException( "Unexpected global [" + identifier + "]" ); } else if ( !type.isInstance( value ) ) { throw new RuntimeException( "Illegal class for global. " + "Expected [" + type.getName() + "], " + "found [" + value.getClass().getName() + "]." ); } else { this.globalResolver.setGlobal( identifier, value ); } } finally { endOperation(); this.ruleBase.readUnlock(); } }
public void closeLiveQuery(final InternalFactHandle factHandle) { try { startOperation(); this.ruleBase.readLock(); this.lock.lock(); final PropagationContext propagationContext = new PropagationContextImpl( getNextPropagationIdCounter(), PropagationContext.ASSERTION, null, null, factHandle, agenda.getActiveActivations(), agenda.getDormantActivations(), getEntryPoint() ); getEntryPointNode().retractQuery( factHandle, propagationContext, this ); propagationContext.evaluateActionQueue( this ); getFactHandleFactory().destroyFactHandle( factHandle ); } finally { this.lock.unlock(); this.ruleBase.readUnlock(); endOperation(); } }
startOperation(); this.lock.lock(); this.ruleBase.readLock();
this.ruleBase.readLock(); this.lock.lock();
public InternalWorkingMemory newWorkingMemory() { this.ruleBase.readLock(); try { InternalWorkingMemory wm = new ReteooWorkingMemory( this.ruleBase.nextWorkingMemoryCounter(), this.ruleBase, this.sessionConf, EnvironmentFactory.newEnvironment(), this.workingMemoryEventSupport, this.agendaEventSupport); wm.setGlobalResolver( this.globalResolver ); final InternalFactHandle handle = wm.getFactHandleFactory().newFactHandle( InitialFactImpl.getInstance(), wm.getObjectTypeConfigurationRegistry().getObjectTypeConf( EntryPoint.DEFAULT, InitialFactImpl.getInstance() ), wm, wm); wm.queueWorkingMemoryAction( new WorkingMemoryReteAssertAction( handle, false, true, null, null ) ); return wm; } finally { this.ruleBase.readUnlock(); } }
this.ruleBase.readLock(); this.wm.startOperation(); this.ruleBase.executeQueuedActions();
try { this.lock.lock(); this.ruleBase.readLock(); this.wm.startOperation(); this.ruleBase.executeQueuedActions();
this.ruleBase.readLock(); try { ReteooWorkingMemory wm = new ReteooWorkingMemory( this.ruleBase.nextWorkingMemoryCounter(),