Examples of DistributedLockRepository


Examples of com.foreach.common.concurrent.locks.distributed.DistributedLockRepository

      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 ) );
        }
      }
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.