Examples of NodeLock


Examples of org.apache.slide.lock.NodeLock

               
                while (locksList.hasMoreElements()) {
                    writer.print("<tr" + (shade ? " bgcolor=\"eeeeee\""
                                              : " bgcolor=\"dddddd\"") +
                                     ">\r\n");
                    NodeLock currentLock = (NodeLock) locksList.nextElement();
                    writer.print("<td align=\"left\"><tt>");
                    writer.print(currentLock.getSubjectUri());
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"left\"><tt>");
                    writer.print(currentLock.getTypeUri());
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"right\"><tt>");
                    writer.print
                        (formatter.format(currentLock.getExpirationDate()));
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"right\"><tt>");
                    writer.print(currentLock.isInheritable());
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"right\"><tt>");
                    writer.print(currentLock.isExclusive());
                    writer.print("</tt></td>\r\n");
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.slide.lock.NodeLock

            return locksVector;
        } else {
            locksVector = new Vector();
            Enumeration lockList = super.enumerateLocks(uri);
            while (lockList.hasMoreElements()) {
                NodeLock tempLock = (NodeLock) lockList.nextElement();
                tempLock.validate(uri.toString());
                locksVector.addElement(tempLock);
            }
            locksCache.put(uri.toString(), locksVector);
            return locksVector;
        }
View Full Code Here

Examples of org.apache.slide.lock.NodeLock

     */
    private XMLValue computeLockDiscovery(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String slideContextPath) throws ServiceAccessException, LinkedObjectNotFoundException, ObjectNotFoundException, LockTokenNotFoundException {
       
        XMLValue xmlValue = new XMLValue();
        Lock lock = nsaToken.getLockHelper();
        NodeLock objectLockToken = null;
        Enumeration lockTokens = lock.enumerateLocks(sToken, revisionDescriptors.getUri(), true);
        Set addedLockIDs = new HashSet();
        while (lockTokens.hasMoreElements()) {
            objectLockToken = (NodeLock) lockTokens.nextElement();
            if (revisionDescriptors.getUri().equals(objectLockToken.getObjectUri()) ||
                objectLockToken.isInheritable()
               ) {
               
                if (!addedLockIDs.contains(objectLockToken.getLockId())) {
                    Element activelock = createActiveLockElement(objectLockToken,
                            slideContextPath);
                    if (activelock != null) {
                        xmlValue.add(activelock);
                        addedLockIDs.add(objectLockToken.getLockId());
                    }
                }
            }
        }
       
View Full Code Here

Examples of org.apache.slide.lock.NodeLock

               
                while (locksList.hasMoreElements()) {
                    writer.print("<tr" + (shade ? " bgcolor=\"eeeeee\""
                                              : " bgcolor=\"dddddd\"") +
                                     ">\r\n");
                    NodeLock currentLock = (NodeLock) locksList.nextElement();
                    writer.print("<td align=\"left\"><tt>");
                    writer.print(currentLock.getSubjectUri());
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"left\"><tt>");
                    writer.print(currentLock.getTypeUri());
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"right\"><tt>");
                    writer.print
                        (formatter.format(currentLock.getExpirationDate()));
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"right\"><tt>");
                    writer.print(currentLock.isInheritable());
                    writer.print("</tt></td>\r\n");
                    writer.print("<td align=\"right\"><tt>");
                    writer.print(currentLock.isExclusive());
                    writer.print("</tt></td>\r\n");
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.slide.lock.NodeLock

    public Element encodeLocks() {
        Element aElementLocks=new Element("locks");
        if (locks==null) return aElementLocks;
       
        for (int aSize=locks.size(),i=0;i<aSize;i++) {
            NodeLock aLock=(NodeLock)locks.elementAt(i);
            Element aElementLock=new Element("lock");
            aElementLock.setAttribute("subjectUri",aLock.getSubjectUri());
            aElementLock.setAttribute("typeUri",aLock.getTypeUri());
            aElementLock.setAttribute("date",dateFormat.format(aLock.getExpirationDate()));
            aElementLock.setAttribute("inheritance",booleanToString(aLock.isInheritable()));
            aElementLock.setAttribute("exclusive",booleanToString(aLock.isExclusive()));
            aElementLock.setAttribute("lockId",aLock.getLockId());
            aElementLock.setAttribute("owner",aLock.getOwnerInfo());
            aElementLocks.addContent(aElementLock);
        }
        return aElementLocks;
    }
View Full Code Here

Examples of org.apache.slide.lock.NodeLock

                boolean aInheritable=new Boolean(aChild.getAttributeValue("inheritance")).booleanValue();
                boolean aNegative=new Boolean(aChild.getAttributeValue("exclusive")).booleanValue();
                String aLockId=aChild.getAttributeValue("lockId");

                locks.addElement(
                    new NodeLock(aLockId,object.getUri(),aSubject,aType,aDateExpiration,aInheritable,aNegative)
                );
            }
        }
        catch (Exception e) {
            e.printStackTrace();
View Full Code Here

Examples of org.apache.slide.lock.NodeLock

                    expirationDate = new Date(timeValue.longValue());
                } catch (NumberFormatException e) {
                    getLogger().log(e, LOG_CHANNEL, Logger.WARNING);
                    expirationDate = new Date();
                }
                NodeLock lock =
                    new NodeLock(
                        res.getString("LCK"),
                        uri.toString(),
                        res.getString("SUBJECT"),
                        res.getString("TYPE"),
                        expirationDate,
View Full Code Here

Examples of org.jboss.cache.lock.NodeLock

      Map nodeMap = w.getNodes();
      for (Iterator i = nodeMap.keySet().iterator(); i.hasNext();)
      {
         WorkspaceNode wn = (WorkspaceNode) nodeMap.get(i.next());
         NodeSPI n = wn.getNode();
         NodeLock lock = n.getLock();
         if (lock.isLocked())
         {
            actual.put(n.getFqn(), lock.isReadLocked() ? READ : WRITE);
         }
      }
      return invokeNextInterceptor(ctx, command);
   }
View Full Code Here

Examples of org.jboss.cache.lock.NodeLock

   }

   @Override
   protected void assertLocked(Fqn fqn, CacheSPI cache, boolean writeLocked)
   {
      NodeLock lock = cache.peek(fqn, true, true).getLock();
      assertTrue("node " + fqn + " is not locked", lock.isLocked());
      if (writeLocked)
      {
         assertTrue("node " + fqn + " is not write-locked" + (lock.isReadLocked() ? " but is read-locked instead!" : "!"), lock.isWriteLocked());
      }
      else
      {
         assertTrue("node " + fqn + " is not read-locked" + (lock.isWriteLocked() ? " but is write-locked instead!" : "!"), lock.isReadLocked());
      }
   }
View Full Code Here

Examples of org.jboss.cache.lock.NodeLock

   }

   @Override
   protected void assertLocked(Fqn fqn, CacheSPI cache, boolean writeLocked)
   {
      NodeLock lock = cache.peek(fqn, true, true).getLock();
      assertTrue("node " + fqn + " is not locked", lock.isLocked());
      if (writeLocked)
      {
         assertTrue("node " + fqn + " is not write-locked" + (lock.isReadLocked() ? " but is read-locked instead!" : "!"), lock.isWriteLocked());
      }
      else
      {
         assertTrue("node " + fqn + " is not read-locked" + (lock.isWriteLocked() ? " but is write-locked instead!" : "!"), lock.isReadLocked());
      }
   }
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.