Package org.jboss.cache.lock

Examples of org.jboss.cache.lock.TimeoutException


    *
    * @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

      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

            modeToUse = preferredMode;
         if (trace)
            log.trace("callRemoteMethods(): valid members are " + recipients + " methods: " + command + " Using OOB? " + useOutOfBandMessage + " modeToUse: " + modeToUse);
         if (channel.flushSupported() && !flushBlockGate.await(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
         {
            throw new TimeoutException("State retrieval timed out waiting for flush unblock. (timeout = " + configuration.getStateRetrievalTimeout() + " millis) ");
         }
         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

   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};
      TimeoutException timeoutException = null;

      boolean trace = log.isTraceEnabled();

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

         log.trace("callRemoteMethods(): valid members are " + validMembers + " methods: " + methodCall + " Using OOB? " + useOutOfBandMessage);

      if (channel.flushSupported())
      {
         if (!flushBlockGate.await(configuration.getStateRetrievalTimeout()))
            throw new TimeoutException("State retrieval timed out waiting for flush unblock.");
      }

//      useOutOfBandMessage = false;

      rsps = responseFilter == null
            ? disp.callRemoteMethods(validMembers, methodCall, modeToUse, timeout, isUsingBuddyReplication, useOutOfBandMessage)
            : disp.callRemoteMethods(validMembers, methodCall, modeToUse, timeout, isUsingBuddyReplication, useOutOfBandMessage, responseFilter);

      // a null response is 99% likely to be due to a marshalling problem - we throw a NSE, this needs to be changed when
      // JGroups supports http://jira.jboss.com/jira/browse/JGRP-193
      if (rsps == null)
      {
         // return null;
         throw new NotSerializableException("RpcDispatcher returned a null.  This is most often caused by args for " + methodCall.getName() + " not being serializable.");
      }
      if (mode == GroupRequest.GET_NONE) return Collections.emptyList();// async case

      if (trace) log.trace("(" + getLocalAddress() + "): responses for method " + methodCall.getName() + ":\n" + rsps);

      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));
         }
         else
         {
View Full Code Here

      catch (InterruptedException e)
      {
         // do nothing
      }
      if (!locked)
         throw new TimeoutException("Unable to lock node " + node.getFqn() + " after timeout " + timeout + " for copying into workspace");
      WorkspaceNode wn = nodeFactory.createWorkspaceNode(node, workspace);
      node.getLock().release(gtx);
      return wn;
   }
View Full Code Here

      do
      {
         // this is an additional check to make sure we don't try for too long.
         if (!firstTry && System.currentTimeMillis() > cutoffTime)
         {
            throw new TimeoutException("Unable to acquire lock on Fqn " + fqn + " after " + timeout + " millis");
         }
         created = lock(ctx, fqn, lockType, createIfNotExists, timeout, acquireLockOnParent, reverseRemoveCheck, createdNodes, skipNotification);
         firstTry = false;
      }
      while (createIfNotExists && (peekNode(ctx, fqn, false, false, false) == null));// keep trying until we have the lock (fixes concurrent remove())
View Full Code Here

               currentNode = parent;
               currentIndex--;
               parent = null;
               if (System.currentTimeMillis() > expiryTime)
               {
                  throw new TimeoutException("Unable to acquire lock on child node " + new Fqn(currentNode.getFqn(), childName) + " after " + timeout + " millis.");
               }
               if (trace) log.trace("Moving one level up, current node is :" + currentNode);
            }
         }
         else
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.