Package org.jboss.cache.lock

Examples of org.jboss.cache.lock.TimeoutException


            modeToUse = preferredMode;
         if (trace)
            log.trace("callRemoteMethods(): valid members are " + recipients + " methods: " + command + " Using OOB? " + useOutOfBandMessage);
         if (channel.flushSupported() && !flushBlockGate.await(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
         {
            throw new TimeoutException("State retrieval timed out waiting for flush unblock.");
         }
         useOutOfBandMessage = false;
         RspList rsps = rpcDispatcher.invokeRemoteCommands(recipients, command, modeToUse, timeout, isUsingBuddyReplication, useOutOfBandMessage, responseFilter);
         if (mode == GroupRequest.GET_NONE) return Collections.emptyList();// async case
         if (trace)
            log.trace("(" + getLocalAddress() + "): responses for method " + command.getClass().getSimpleName() + ":\n" + rsps);
         // short-circuit no-return-value calls.
         if (rsps == null) return Collections.emptyList();
         List<Object> retval = new ArrayList<Object>(rsps.size());
         for (Rsp rsp : rsps.values())
         {
            if (rsp.wasSuspected() || !rsp.wasReceived())
            {
               CacheException ex;
               if (rsp.wasSuspected())
               {
                  ex = new SuspectException("Suspected member: " + rsp.getSender());
               }
               else
               {
                  ex = new TimeoutException("Replication timeout for " + rsp.getSender());
               }
               retval.add(new ReplicationException("rsp=" + rsp, ex));
               success = false;
            }
            else
View Full Code Here


   private byte[] acquireState(Fqn fqn) throws CacheException
   {
      // Call _getState with progressively longer timeouts until we
      // get state or it doesn't throw a TimeoutException
      long[] timeouts = {400, 800, 1600, configuration.getStateRetrievalTimeout()};
      TimeoutException timeoutException = null;

      for (int i = 0; i < timeouts.length; i++)
      {
         boolean force = (i == timeouts.length - 1);
View Full Code Here

      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

      boolean mustLoad = false;
      try
      {
         if (needLock && !lockManager.lock(n, LockType.READ, lockOwner))
         {
            throw new TimeoutException("Unable to acquire lock on " + fqn + ". Lock info: " + lockManager.printLockInfo(n));
         }
         mustLoad = mustLoad(n, key, allKeys || isMove);
      }
      finally
      {
View Full Code Here

   private static class SecretiveStateCacheMessageListener extends ChannelMessageListener
   {
      @Override
      public void setState(byte[] new_state)
      {
         setStateException = new TimeoutException("Planned Timeout");
      }
View Full Code Here

      }

      @Override
      public void setState(InputStream istream)
      {
         setStateException = new TimeoutException("Planned Timeout");
      }
View Full Code Here

      }

      @Override
      public void setState(String state_id, byte[] state)
      {
         setStateException = new TimeoutException("Planned Timeout");
      }
View Full Code Here

      }

      @Override
      public void setState(String state_id, InputStream istream)
      {
         setStateException = new TimeoutException("Planned Timeout");
      }
View Full Code Here

      boolean mustLoad = false;
      try
      {
         if (needLock && !lockManager.lock(n, LockType.READ, lockOwner))
         {
            throw new TimeoutException("Unable to acquire lock on " + fqn + ". Lock info: " + lockManager.printLockInfo(n));
         }
         mustLoad = mustLoad(fqn, n, key, allKeys || isMove);
      }
      finally
      {
View Full Code Here

      plainCache_ = cache;
   }
  
   Map getData(Fqn fqn, boolean gravitate)
   {
      TimeoutException ex = null;
      for (int i = 0; i < RETRY; i++)
      {
         try
         {           
            if (gravitate)
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.