Package javax.jcr.lock

Examples of javax.jcr.lock.LockException


        PathMap.Element element = lockMap.map(path, false);
        AbstractLockInfo info = (AbstractLockInfo) element.get();
        if (info != null) {
            if (element.hasPath(path) || info.deep) {
                if (session != info.getLockHolder()) {
                    throw new LockException("Node locked.");
                }
            }
        }
    }
View Full Code Here


                            session.addListener((LockInfo) info);
                        }
                    } else {
                        String msg = "Cannot add lock token: lock already held by other session.";
                        log.warn(msg);
                        throw new LockException(msg);
                    }
                }
            }
            // inform SessionLockManager
            getSessionLockManager(session).lockTokenAdded(lt);
        } catch (IllegalArgumentException e) {
            String msg = "Bad lock token: " + e.getMessage();
            log.warn(msg);
            throw new LockException(msg);
        }
    }
View Full Code Here

                    if (session == info.getLockHolder()) {
                        info.setLockHolder(null);
                    } else {
                        String msg = "Cannot remove lock token: lock held by other session.";
                        log.warn(msg);
                        throw new LockException(msg);
                    }
                }
            }
            // inform SessionLockManager
            getSessionLockManager(session).lockTokenRemoved(lt);
        } catch (IllegalArgumentException e) {
            String msg = "Bad lock token: " + e.getMessage();
            log.warn(msg);
            throw new LockException(msg);
        }
    }
View Full Code Here

        try {
            Path path = getPath(sysSession, nodeId);
            PathMap.Element element = lockMap.map(path, true);
            if (element == null) {
                throw new LockException("Node not locked: " + path.toString());
            }
            AbstractLockInfo info = (AbstractLockInfo) element.get();
            if (info == null) {
                throw new LockException("Node not locked: " + path.toString());
            }
            element.set(null);
            info.setLive(false);

            save();
View Full Code Here

                return;
            }
        }
        // sessionInfo doesn't contain the given lock token and is therefore
        // not the lock holder
        throw new LockException("Unable to remove locktoken '" + lt + "' from Session.");
    }
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

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

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

      try
      {
         lockFile.createNewFile();
      }
      catch (IOException e)
      {
         throw new LockException(e);
      }
   }
View Full Code Here

         // throw new LockException("Persistent lock information not exists");
         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

            if (!PrivilegedFileHelper.exists(lockFile))
            {
               log.warn("Persistent lock information for node id " + list[i] + " doesn't exists");
            }
            if (!PrivilegedFileHelper.delete(lockFile))
               throw new LockException("Fail to remove lock information");
         }
      }
      catch (RepositoryException e)
      {
         log.error("Unable to remove lock files due to error " + e, e);
         throw new LockException(e);
      }
   }
View Full Code Here

      }

      // Check locking
      if (!checkLocking())
      {
         throw new LockException("Node " + getPath() + " is locked ");
      }

      doAddMixin(type);
   }
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.