if ( startDelay > 0 ) {
Thread.sleep( startDelay );
}
AcrossContext context = createContext();
DistributedLockRepository distributedLockRepository = AcrossContextUtils.getBeanRegistry( context )
.getBeanOfType(
DistributedLockRepository.class );
ExecutorService fixedThreadPool = Executors.newFixedThreadPool( 50 );
List<Executor> executors = new ArrayList<>( LOCKS_PER_BATCH * EXECUTORS_PER_LOCK );
for ( int i = 0; i < LOCKS_PER_BATCH; i++ ) {
DistributedLock lock = distributedLockRepository.getLock( "batch-lock-" + i );
for ( int j = 0; j < EXECUTORS_PER_LOCK; j++ ) {
executors.add( new Executor( lock, 10 ) );
}
}