Package java.util.concurrent.locks

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


      {
         Lock lock = existing.getLock();
        
         try
         {
            lock.lockInterruptibly();
         }
         catch (InterruptedException ie)
         {
            Thread.currentThread().interrupt();
            this.log.info(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

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
     
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         Thread.interrupted();
        
View Full Code Here

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         Thread.interrupted();
View Full Code Here

    }

    public void execute(final Runnable task) throws RejectedExecutionException {
        final Lock lock = this.lock;
        try {
            lock.lockInterruptibly();
            try {
                for (;;) {
                    if (stop) {
                        throw new RejectedExecutionException("Executor is stopped");
                    }
View Full Code Here

        }
    }

    public boolean awaitTermination(final long timeout, final TimeUnit unit) throws InterruptedException {
        final Lock lock = this.lock;
        lock.lockInterruptibly();
        try {
            if (workers.contains(Thread.currentThread())) {
                throw new IllegalStateException("Cannot await termination of a thread pool from one of its threads");
            }
            final long start = System.currentTimeMillis();
View Full Code Here

  {
    if (!this.isAlive(database, Level.DEBUG)) return false;
   
    Lock lock = this.lockManager.writeLock(null);
   
    lock.lockInterruptibly();
   
    try
    {
      if (this.balancer.contains(database)) return false;
     
View Full Code Here

      if (lock == null)
         throw new ResourceException(bundle.unableObtainLock());

      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         Thread.interrupted();
        
View Full Code Here

         throw new ResourceException(bundle.unableObtainLock());
      }

      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         Thread.interrupted();
View Full Code Here

  {
    if (!this.isAlive(database, Level.DEBUG)) return false;
   
    Lock lock = this.lockManager.writeLock(null);
   
    lock.lockInterruptibly();
   
    try
    {
      if (this.balancer.contains(database)) return false;
     
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.