Package javax.ejb

Examples of javax.ejb.ConcurrentAccessTimeoutException


        } else {
            // try to get a lock within the specified period.
            try {
                lockAcquired = lock.tryLock(accessTimeout.getTime(), accessTimeout.getUnit());
            } catch (InterruptedException e) {
                throw (ConcurrentAccessTimeoutException) new ConcurrentAccessTimeoutException("Unable to get " + (read ? "read" : "write") + " lock within specified time on '" + runMethod.getName() + "' method for: " + instance.bean.getClass().getName()).initCause(e);
            }
        }

        // Did we acquire the lock to the current execution?
        if (!lockAcquired) {
            throw new ConcurrentAccessTimeoutException("Unable to get " + (read ? "read" : "write") + " lock on '" + runMethod.getName() + "' method for: " + instance.bean.getClass().getName());
        }

        return lock;
    }
View Full Code Here


            if (entry != null) {
                instance = entry.get();
                instance.setPoolEntry(entry);
            }
        } catch (TimeoutException e) {
            ConcurrentAccessTimeoutException timeoutException = new ConcurrentAccessTimeoutException("No instances available in Stateless Session Bean pool.  Waited " + data.accessTimeout.toString());
            timeoutException.fillInStackTrace();

            throw new ApplicationException(timeoutException);
        } catch (InterruptedException e) {
            Thread.interrupted();
            throw new OpenEJBException("Unexpected Interruption of current thread: ", e);
View Full Code Here

        throw new ApplicationException("Unable to get lock.", e);
      }
      }
        // Did we acquire the lock to the current execution?
        if (!lockAcquired) {
            throw new ApplicationException(new ConcurrentAccessTimeoutException("Unable to get lock."));
        }
       
        if (instance.getTransaction() != null) {
            if (!instance.getTransaction().equals(currentTransaction) && !instance.getLock().tryLock()) {
                throw new ApplicationException(new RemoteException("Instance is in a transaction and cannot be invoked outside that transaction.  See EJB 3.0 Section 4.4.4"));
View Full Code Here

 
  public static void lockRead(Lock readLock, long timeout)
  {
    try {
      if (! readLock.tryLock(timeout, TimeUnit.MILLISECONDS))
        throw new ConcurrentAccessTimeoutException(L.l("Timed out acquiring read lock."));
    } catch (InterruptedException e) {
      throw new ConcurrentAccessTimeoutException(L.l("Thread interruption acquiring read lock: {0}", e.getMessage()));
    }
  }
View Full Code Here

      throw new IllegalLoopbackException(L.l("Cannot attempt a nested write lock without an existing write lock."));
    }
   
    try {
      if (! lock.writeLock().tryLock(timeout, TimeUnit.MILLISECONDS))
        throw new ConcurrentAccessTimeoutException(L.l("Timed out acquiring write lock."));
    } catch (InterruptedException e) {
      throw new ConcurrentAccessTimeoutException(L.l("Thread interruption acquiring write lock: " + e.getMessage()));
    }
  }
View Full Code Here

TOP

Related Classes of javax.ejb.ConcurrentAccessTimeoutException

Copyright © 2018 www.massapicom. 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.