Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Lock.lockInterruptibly()


               // The lock will be initialized when the first connection listener is obtained
               Lock lock = (Lock)transactionSynchronizationRegistry.getResource(LockKey.INSTANCE);
               try
               {
                  lock.lockInterruptibly();
               }
               catch (Throwable t)
               {
                  rethrowAsSystemException("Unable to begin transaction with JCA lazy enlistment scenario",
                                           tx, t);
View Full Code Here


               // The lock will be initialized when the first connection listener is obtained
               Lock lock = (Lock)transactionSynchronizationRegistry.getResource(LockKey.INSTANCE);
               try
               {
                  lock.lockInterruptibly();
               }
               catch (Throwable t)
               {
                  rethrowAsSystemException("Unable to begin transaction with JCA lazy enlistment scenario",
                                           tx, t);
View Full Code Here

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
     
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         throw new ResourceException(bundle.unableObtainLock(), ie);
      }
View Full Code Here

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         throw new ResourceException(bundle.unableObtainLock(), ie);
      }
View Full Code Here

               // The lock may need to be initialized if we are in the first lazy enlistment
               Lock lock = getLock();
               try
               {
                  lock.lockInterruptibly();
               }
               catch (Throwable t)
               {
                  rethrowAsSystemException("Unable to begin transaction with JCA lazy enlistment scenario",
                                           tx, t);
View Full Code Here

      {
         Lock lock = existing.getLock();
        
         try
         {
            lock.lockInterruptibly();
         }
         catch (InterruptedException ie)
         {
            this.log.info(ie);
            return;
View Full Code Here

        This is predicated on the assumption that readLocks CAN successfully acquire
        without contention. If this is not true, this method will fail.
        */
        final ReadWriteLock rwLock = new ReentrantZkReadWriteLock2(baseLockPath,zkSessionManager);
        Lock writeLock = rwLock.writeLock();
        writeLock.lockInterruptibly();
        Future<Void> future;
        try{
            future = testService.submit(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
View Full Code Here

        This is predicated on the assumption that readLocks CAN successfully acquire
        without contention. If this is not true, this method will fail.
        */
        ReadWriteLock rwLock = new ReentrantZkReadWriteLock2(baseLockPath,zkSessionManager);
        Lock writeLock = rwLock.writeLock();
        writeLock.lockInterruptibly();
        Future<Void> future;
        try{
            future = testService.submit(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
View Full Code Here

        This is predicated on the assumption that readLocks CAN successfully acquire
        without contention. If this is not true, this method will fail.
        */
        ReadWriteLock rwLock = new ReentrantZkReadWriteLock2(baseLockPath,zkSessionManager);
        Lock writeLock = rwLock.writeLock();
        writeLock.lockInterruptibly();
        Future<Void> future;
        try{
            future = testService.submit(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
View Full Code Here

    @Test(timeout = 1000l)
    public void testLockInterruptiblyWorksDifferentInstances() throws Exception{
        final CountDownLatch latch = new CountDownLatch(1);
        Lock firstLock = new ReentrantZkLock2(baseLockPath, zkSessionManager);
        firstLock.lockInterruptibly();
        Future<Void>errorFuture;
        try{
            errorFuture = testService.submit(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
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.