Examples of SessionConfiguration


Examples of org.drools.SessionConfiguration

                      rconf.getEventProcessingMode() );
        assertEquals( AssertBehaviour.EQUALITY,
                      rconf.getAssertBehaviour() );

        StatefulKnowledgeSessionImpl ksession1 = (StatefulKnowledgeSessionImpl) context.getBean( "ksession1" );
        SessionConfiguration sconf = ksession1.session.getSessionConfiguration();
        assertTrue( sconf.isKeepReference() );
        assertEquals( ClockType.REALTIME_CLOCK,
                      sconf.getClockType() );
        Map<String, WorkItemHandler> wih = sconf.getWorkItemHandlers();
        assertEquals( 4,
                      wih.size() );
        assertTrue( wih.containsKey( "wih1" ) );
        assertTrue( wih.containsKey( "wih2" ) );
        assertTrue( wih.containsKey( "Human Task" ) );
        assertTrue( wih.containsKey( "MyWork" ) );
        assertNotSame( wih.get( "wih1" ),
                       wih.get( "wih2" ) );
        assertEquals( HumanTaskHandler.class,
                      wih.get( "wih1" ).getClass() );
        assertEquals( HumanTaskHandler.class,
                      wih.get( "wih2" ).getClass() );

        StatefulKnowledgeSessionImpl ksession2 = (StatefulKnowledgeSessionImpl) context.getBean( "ksession2" );
        sconf = ksession2.session.getSessionConfiguration();
        assertFalse( sconf.isKeepReference() );
        assertEquals( ClockType.PSEUDO_CLOCK,
                      sconf.getClockType() );

    }
View Full Code Here

Examples of org.drools.SessionConfiguration

            throw new RuleExecutionSetNotFoundException( "no execution set bound to: " + bindUri );
        }

        this.setRuleExecutionSet( ruleSet );

        SessionConfiguration conf = new SessionConfiguration();
        conf.setKeepReference( true );
        initSession( conf );
    }
View Full Code Here

Examples of org.drools.SessionConfiguration

     * A reset will not reset the state on the default object filter for a
     * <code>RuleExecutionSet</code>.
     */
    public void reset() {
        // stateful rule sessions should not be high load, thus safe to keep references
        initSession( new SessionConfiguration() );
    }
View Full Code Here

Examples of org.drools.SessionConfiguration

                      this.ruleBase.getStatefulSessions() );
        assertNotContains( this.wm3, this.ruleBase.getStatefulSessions() );
    }

    public void testNoKeepReference() throws Exception {
        SessionConfiguration conf = new SessionConfiguration();
        conf.setKeepReference( false );
        final WorkingMemory wm5 = this.ruleBase.newStatefulSession( conf, null );
        final WorkingMemory wm6 = this.ruleBase.newStatefulSession( conf, null );
        assertLength( 4,
                      this.ruleBase.getStatefulSessions() );
        assertNotContains( wm5, this.ruleBase.getStatefulSessions() );
View Full Code Here

Examples of org.drools.SessionConfiguration

    }

    public StatelessKnowledgeSessionImpl(final InternalRuleBase ruleBase,
                                         final KnowledgeSessionConfiguration conf) {
        this.ruleBase = ruleBase;
        this.conf = (conf != null) ? conf : new SessionConfiguration();
        this.environment = EnvironmentFactory.newEnvironment();
       
        synchronized ( this.ruleBase.getPackagesMap() ) {
            if ( ruleBase.getConfiguration().isSequential() ) {
                this.ruleBase.getReteooBuilder().order();
View Full Code Here

Examples of org.drools.SessionConfiguration

        }
        return list;
    }

    public StatefulKnowledgeSession newStatefulKnowledgeSession() {
      return newStatefulKnowledgeSession(new SessionConfiguration(), EnvironmentFactory.newEnvironment() );
    }
View Full Code Here

Examples of org.drools.SessionConfiguration

    }
   
    public StatefulKnowledgeSession newStatefulKnowledgeSession(KnowledgeSessionConfiguration conf, Environment environment) {
        // NOTE if you update here, you'll also need to update the JPAService
        if ( conf == null ) {
            conf = new SessionConfiguration();
        }
       
        if ( environment == null ) {
            environment = EnvironmentFactory.newEnvironment();
        }
View Full Code Here

Examples of org.drools.SessionConfiguration

                                 final InternalRuleBase ruleBase,
                                 final ExecutorService executorService) {
        this( id,
              ruleBase,
              executorService,
              new SessionConfiguration(),
              EnvironmentFactory.newEnvironment() );
    }
View Full Code Here

Examples of org.drools.SessionConfiguration

    public InternalWorkingMemory newWorkingMemory() {
        synchronized ( this.ruleBase.getPackagesMap() ) {
            InternalWorkingMemory wm = new ReteooWorkingMemory( this.ruleBase.nextWorkingMemoryCounter(),
                                                                this.ruleBase,
                                                                new SessionConfiguration(),
                                                                EnvironmentFactory.newEnvironment() );

            wm.setGlobalResolver( this.globalResolver );
            wm.setWorkingMemoryEventSupport( this.workingMemoryEventSupport );
            wm.setAgendaEventSupport( this.agendaEventSupport );
View Full Code Here

Examples of org.drools.SessionConfiguration

    public KnowledgeBaseConfiguration newKnowledgeBaseConfiguration(Properties properties, ClassLoader classLoader) {
        return new RuleBaseConfiguration(classLoader, properties);
    }       
   
    public KnowledgeSessionConfiguration newKnowledgeSessionConfiguration() {
        return new SessionConfiguration();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.