public StatelessKnowledgeSessionImpl(final InternalRuleBase ruleBase, final KnowledgeAgent kagent, final KnowledgeSessionConfiguration conf) { this.ruleBase = ruleBase; this.kagent = kagent; this.conf = (conf != null) ? conf : SessionConfiguration.getDefaultInstance(); this.environment = EnvironmentFactory.newEnvironment(); if ( this.ruleBase != null ) { // FIXME: this same code exists in ReteooRuleBase#newStatelessSession() this.ruleBase.lock(); try { if ( ruleBase.getConfiguration().isSequential() ) { this.ruleBase.getReteooBuilder().order(); } } finally { this.ruleBase.unlock(); } } }
ruleBase.lock(); // XXX: readlock might be enough, no idea what order() does. try { if ( ruleBase.getConfiguration().isSequential() ) {
public void initInitialFact( InternalRuleBase ruleBase, MarshallerReaderContext context ) { ruleBase.lock(); Object initialFact = InitialFactImpl.getInstance(); ObjectTypeConf otc = this.defaultEntryPoint.getObjectTypeConfigurationRegistry() .getObjectTypeConf( this.defaultEntryPoint.entryPoint, initialFact ); this.initialFactHandle = ruleBase.getConfiguration().getComponentFactory().getFactHandleFactoryService().newFactHandle( 0, initialFact, 0, otc, this, this.defaultEntryPoint ); final PropagationContext pctx = new PropagationContextImpl( 0, PropagationContext.ASSERTION, null, null , initialFactHandle, 0, 0, defaultEntryPoint.getEntryPoint(), context ); otc.getConcreteObjectTypeNode().assertObject( this.initialFactHandle, pctx, this ); // ADDED, NOT IN THE ORIGINAL 6.x COMMIT pctx.evaluateActionQueue( this ); ruleBase.unlock(); }
buildContext ); context.ruleBase.lock(); try {
public static ObjectTypeNode attachObjectTypeNode(BuildContext context, ObjectType objectType) { final InternalRuleBase ruleBase = context.getRuleBase(); ruleBase.lock(); try { InternalWorkingMemory[] wms = context.getWorkingMemories();