/** * Creates the actual partition managers and their tasks for multi-thread * processing */ private void initPartitionManagers() { if ( this.ruleBase.getConfiguration().isMultithreadEvaluation() ) { this.partitionManager = new PartitionManager( this ); for ( RuleBasePartitionId partitionId : this.ruleBase.getPartitionIds() ) { this.partitionManager.manage( partitionId ); } } }
/** * This method is called to start the multiple partition threads when * running in multi-thread mode */ public void startPartitionManagers() { startOperation(); try { if ( this.ruleBase.getConfiguration().isMultithreadEvaluation() ) { int maxThreads = (this.ruleBase.getConfiguration().getMaxThreads() > 0) ? this.ruleBase.getConfiguration().getMaxThreads() : this.ruleBase.getPartitionIds().size(); if ( this.threadPool.compareAndSet( null, createExecutorService( maxThreads ) ) ) { this.partitionManager.setPool( this.threadPool.get() ); } } } finally { endOperation(); } }