final Environment environment) {
if ( this.getConfiguration().isSequential() ) {
throw new RuntimeException( "Cannot have a stateful rule session, with sequential configuration set to true" );
}
ExecutorService executor = ExecutorServiceFactory.createExecutorService( this.getConfiguration().getExecutorService() );
readLock();
try {
ReteooStatefulSession session = new ReteooStatefulSession( id,
this,
executor,
sessionConfig,
environment );
new StatefulKnowledgeSessionImpl(session);
executor.setCommandExecutor( new CommandExecutor( session ) );
if ( sessionConfig.isKeepReference() ) {
super.addStatefulSession( session );
for (Object listener : session.getRuleBaseUpdateListeners()) {
addEventListener((RuleBaseEventListener) listener);