Package org.jboss.cache

Examples of org.jboss.cache.DataNode.acquire()


          final List exceptions = new ArrayList();
          final List timeouts = new ArrayList();


          // get a hold of the WL first
          root.acquire(Thread.currentThread(), 10, DataNode.LOCK_TYPE_WRITE);

          Thread[] t = new Thread[threads];

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


                {
                   for (int i=0; i<loops; i++)
                   {
                      try
                      {
                         root.acquire(Thread.currentThread(), 10, DataNode.LOCK_TYPE_WRITE);
                      }
                      catch (TimeoutException te)
                      {
                         // expected
                         timeouts.add( te );
View Full Code Here

          final List exceptions = new ArrayList();
          final List timeouts = new ArrayList();


          // get a hold of the WL first
          node.acquire(Thread.currentThread(), 10, DataNode.LOCK_TYPE_WRITE);

          Thread[] t = new Thread[threads];

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

                {
                   for (int i=0; i<loops; i++)
                   {
                      try
                      {
                         node.acquire(Thread.currentThread(), 10, DataNode.LOCK_TYPE_WRITE);
                      }
                      catch (TimeoutException te)
                      {
                         // expected
                         timeouts.add( te );
View Full Code Here

            WorkspaceNode workspaceNode = (WorkspaceNode) it.next();
            DataNode node = workspaceNode.getNode();

            boolean writeLock = workspaceNode.isDirty() || workspaceNode.isCreated() || workspaceNode.isDeleted() || (workspaceNode.isChildrenModified() && cache.getLockParentForChildInsertRemove());

            boolean acquired = node.acquire(gtx, lockAcquisitionTimeout, writeLock ? DataNode.LOCK_TYPE_WRITE : DataNode.LOCK_TYPE_READ);
            if (acquired)
            {
                if (log.isTraceEnabled()) log.trace("acquired lock on node " + node.getName());
                te.addLock(node.getLock());
            }
View Full Code Here

        for (Iterator it = nodes.iterator(); it.hasNext();)
        {
            WorkspaceNode workspaceNode = (WorkspaceNode) it.next();
            DataNode node = workspaceNode.getNode();

            boolean acquired = node.acquire(gtx, lockAcquisitionTimeout, DataNode.LOCK_TYPE_WRITE);
            if (acquired)
            {
                if (log.isTraceEnabled()) log.trace("acquired lock on node " + node.getName());
                cache.getTransactionTable().addLock(gtx, node.getLock());
            }
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.