Package org.jboss.cache.lock

Examples of org.jboss.cache.lock.TimeoutException


      public void waitForFlushStart(long timeout) throws InterruptedException
      {
         if (channel.flushSupported() && !flushWaitGate.await(timeout, TimeUnit.MILLISECONDS))
         {
            throw new TimeoutException("State retrieval timed out waiting for flush to block. (timeout = " + CachePrinter.prettyPrint(timeout) + " )");
         }
      }
View Full Code Here


         while (true)
         {
            try
            {
               if (!coordinationLock.readLock().tryLock(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
                  throw new TimeoutException("Could not obtain processing lock");

               return;
            }
            catch (InterruptedException ie)
            {
View Full Code Here

         while (true)
         {
            try
            {
               if (!coordinationLock.writeLock().tryLock(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
                  throw new TimeoutException("Could not obtain processing lock");

               return;
            }
            catch (InterruptedException ie)
            {
View Full Code Here

         while (true)
         {
            try
            {
               if (!flushBlockGate.await(timeout, TimeUnit.MILLISECONDS))
                  throw new TimeoutException("State retrieval timed out waiting for flush to unblock. (timeout = " + CachePrinter.prettyPrint(timeout) + ")");

               return;
            }
            catch (InterruptedException ie)
            {
View Full Code Here

         while (true)
         {
            try
            {
               if (!flushWaitGate.await(timeout, TimeUnit.MILLISECONDS))
                  throw new TimeoutException("State retrieval timed out waiting for flush to block. (timeout = " + CachePrinter.prettyPrint(timeout) + ")");

               return;
            }
            catch (InterruptedException ie)
            {
View Full Code Here

      // nothing wrong, just means that we fail to record the lock.  And that is a problem.
      // Better to check our records and lock again if necessary.
      if (!ctx.hasLock(fqn)) {
         if (!lockManager.lockAndRecord(fqn, WRITE, ctx)) {
            Object owner = lockManager.getWriteOwner(fqn);
            throw new TimeoutException("Unable to acquire lock on Fqn [" + fqn + "] after [" + ctx.getLockAcquisitionTimeout(defaultLockAcquisitionTimeout) + "] milliseconds for requestor [" + lockManager.getLockOwner(ctx) + "]! Lock held by [" + owner + "]");
         }
         return true;
      }
      return false;
   }
View Full Code Here

    * @param id
    * @return
    */
   Object removeLocal(Fqn<?> fqn, String id)
   {
      TimeoutException ex = null;
      for (int i = 0; i < RETRY; i++)
      {
         try
         {
            plainCache_.getInvocationContext().getOptionOverrides()
View Full Code Here

    *
    * @param fqn
    */
   void removeLocal(Fqn<?> fqn)
   {
      TimeoutException ex = null;
      for (int i = 0; i < RETRY; i++)
      {
         try
         {
            plainCache_.getInvocationContext().getOptionOverrides()
View Full Code Here

      throw new RuntimeException(RETRY_FAIL_MSG, ex);
   }
  
   void evictSubtree(Fqn<?> fqn)
   {     
      TimeoutException ex = null;
      for (int i = 0; i < RETRY; i++)
      {
         try
         {
            plainCache_.evict(fqn, true);
View Full Code Here

         // test if we acquired the lock
         locked = lockManager.getReadOwners(node).contains(gtx);
      }

      if (!locked)
         throw new TimeoutException("Unable to lock node " + node.getFqn() + " after timeout " + timeout + " for copying into workspace");

      WorkspaceNode<?, ?> wn = nodeFactory.createWrappedNode(node, workspace);

      lockManager.unlock(node, gtx);
      return wn;
View Full Code Here

TOP

Related Classes of org.jboss.cache.lock.TimeoutException

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.