Package javax.jcr.lock

Examples of javax.jcr.lock.LockException


         Fqn<String> fqn = makeLockFqn(newLockData.getNodeIdentifier());
         cache.put(fqn, LOCK_DATA, newLockData);
      }
      catch (RepositoryException e)
      {
         throw new LockException(e);
      }
      finally
      {
         if (connection != null)
         {
View Full Code Here


         }
      }
      else
      {
         // no pending lock found
         throw new LockException("No lock in pending locks");
      }
   }
View Full Code Here

               sessMgr.notifyLockRemoved(nodeIdentifier);
            }
         }
         catch (RepositoryException e)
         {
            throw new LockException(e);
         }
         finally
         {
            if (connection != null)
            {
View Full Code Here

               internalUnLock(sessionId, identifier);
            }
         }
         catch (RepositoryException e)
         {
            throw new LockException(e.getMessage(), e);
         }
      }
View Full Code Here

         // this will return null if success. And old data if something exists...
         LockData oldLockData = (LockData)node.putIfAbsent(LOCK_DATA, lockData);

         if (oldLockData != null)
         {
            throw new LockException("Unable to write LockData. Node [" + lockData.getNodeIdentifier()
               + "] already has LockData!");
         }

         session.notifyLockPersisted(nodeIdentifier);
      }
      else
      {
         throw new LockException("No lock in pending locks");
      }
   }
View Full Code Here

      LockData lData = getLockData((NodeData)node.getData(), SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
      if (lData != null)
      {
         if (lData.getNodeIdentifier().equals(node.getInternalIdentifier()))
         {
            throw new LockException("Node already locked: " + node.getData().getQPath());
         }
         else if (lData.isDeep())
         {
            throw new LockException("Parent node has deep lock.");
         }
      }

      if (isDeep && getLockData((NodeData)node.getData(), SEARCH_CLOSEDCHILD) != null)
      {
         throw new LockException("Some child node is locked.");
      }

      String lockToken = IdGenerator.generate();
      lData =
         new LockData(node.getInternalIdentifier(), lockToken, isDeep, isSessionScoped, node.getSession().getUserID(),
View Full Code Here

      LockData lData = getLockData((NodeData)node.getData(), SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);

      if (lData == null || (!node.getInternalIdentifier().equals(lData.getNodeIdentifier()) && !lData.isDeep()))
      {
         throw new LockException("Node not locked: " + node.getData().getQPath());

      }
      return new LockImpl(node.getSession(), lData);
   }
View Full Code Here

         }
         pendingLocks.remove(nodeIdentifier);
      }
      else
      {
         throw new LockException("No lock in pending locks");
      }
   }
View Full Code Here

      log.debug("add event fire");
      final File lockFile = new File(rootDir, lock.getNodeIdentifier());

      if (PrivilegedFileHelper.exists(lockFile))
      {
         throw new LockException("Persistent lock information already exists");
      }

      try
      {
         SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
         {
            public Void run() throws Exception
            {
               lockFile.createNewFile();
               return null;
            }
         });
      }
      catch (IOException e)
      {
         throw new LockException(e);
      }
   }
View Full Code Here

         log.warn("Persistent lock information  for node " + lock.getNodeIdentifier() + " doesn't exists");
         return;
      }
      if (!PrivilegedFileHelper.delete(lockFile))
      {
         throw new LockException("Fail to remove lock information");
      }

   }
View Full Code Here

TOP

Related Classes of javax.jcr.lock.LockException

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.