Examples of Lock


Examples of org.apache.slide.lock.Lock

     * @throws   ObjectNotFoundException
     */
    private XMLValue computeLockDiscovery(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ServiceAccessException, LinkedObjectNotFoundException, ObjectNotFoundException, LockTokenNotFoundException {
       
        XMLValue xmlValue = new XMLValue();
        Lock lock = nsaToken.getLockHelper();
        NodeLock objectLockToken = null;
        Enumeration lockTokens = lock.enumerateLocks(readonlySlideToken(), revisionDescriptors.getUri(), true);
        Set addedLockIDs = new HashSet();
        while (lockTokens.hasMoreElements()) {
            objectLockToken = (NodeLock) lockTokens.nextElement();
            if (revisionDescriptors.getUri().equals(objectLockToken.getObjectUri()) ||
                objectLockToken.isInheritable()
View Full Code Here

Examples of org.apache.webdav.lib.Lock

            if (href != null) {
                lockToken = DOMUtils.getTextValue(href);
            }
        }

        return new Lock(ls, lt, d, owner, t, lockToken);

    }
View Full Code Here

Examples of org.apache.ws.util.lock.Lock

    {

        LOG.debug( MSG.getMessage( Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf( key ) ) );

        Resource resource = null;
        Lock lock = getLock( key );
        try
        {
            lock.acquire();
        }
        catch ( InterruptedException ie )
        {
            throw new ResourceException( ie );
        }

        try
        {
            resource = get( key );
            if ( m_cache != null )
            {
                m_cache.update( resource );
            }
        }
        finally
        {
            lock.release();
        }

        return resource;
    }
View Full Code Here

Examples of org.chaidb.db.lock.Lock

        //add by stanley
        boolean hasPageForOverflow = false;
        PageNumber PgnForOverflow = null;
        DataPage DataPageForOverflow = null;
        Lock lockforOverflow = null;

        PageNumber latestDataPageNumber = buffer.getLatestDataPage(docid, pageNumber.getTreeId(), needLog ? new Integer(txnId) : null);

        Lock lock = null;
        boolean isValidPage;
        while (latestDataPageNumber != null && latestDataPageNumber.getPageNumber() > 0) {

            lock = BTreeLock.acquire(kContext, LockManager.LOCK_WAITING, latestDataPageNumber, LockManager.LOCK_WRITE);
View Full Code Here

Examples of org.chaidb.db.lock.Lock

     *
     * @return Lock the lock we get
     */
    public static Lock acquire(KernelContext kc, int flag, PageNumber p, int lockType) throws ChaiDBException {
        int locker = kc.getLocker();
        Lock lock = null;


        lock = lm.get(locker, flag, lm.OBJECT_BTREE, p.uniqueID(), lockType);

        if (_debug) {
            logger.debug("[AllLocks]" + "lock:" + lock.getLockID());

        }
        return lock;
    }
View Full Code Here

Examples of org.chaidb.db.lock.Lock

            needn't downgrade lock,directly return */
        if (ISOLATION_LEVEL == ISOLATION_LEVEL_COMMIT_READ) {
            return lock;
        }
        //here we reacquire a new lock and release the old one.
        Lock newlock = lm.get(kc.getLocker(), LockManager.LOCK_WAITING, lm.OBJECT_BTREE, lock.getLockID(), lockType);
        lm.put(lock);
        return newlock;
    }
View Full Code Here

Examples of org.chaidb.db.lock.Lock

    private Logger logger = Logger.getLogger(LockableBTree.class);

    protected int id;

    public void acquire(KernelContext kContext, int mode) throws ChaiDBException {
        Lock lock = null;
        try {
            if (mode == IBTreeConst.READ_MODE) {
                lock = BTreeLock.acquire(kContext, LockManager.LOCK_WAITING, new PageNumber(id, 0, 0), LockManager.LOCK_READ);
            } else if (mode == IBTreeConst.WRITE_MODE) {
                lock = BTreeLock.acquire(kContext, LockManager.LOCK_WAITING, new PageNumber(id, 0, 0), LockManager.LOCK_WRITE);
View Full Code Here

Examples of org.chaidb.db.lock.Lock

    }

    public void release(KernelContext kContext) {
        try {
            Lock lock = kContext.getLock(getBTreeName());
            if (lock != null) {
                if (kContext.getNeedLog()) {
                    if (lock.getMode() == LockManager.LOCK_READ) {
                        BTreeLock.release(kContext, id, lock);

                    } else {
                        lock = BTreeLock.change(kContext, lock, id, LockManager.LOCK_READ);
                    }
View Full Code Here

Examples of org.exist.storage.lock.Lock

    }

    public void lock(DBBroker broker, boolean exclusive, boolean checkExisting) throws LockException {
        sort();
        DocumentImpl d;
        Lock dlock;
        for (int idx = 0; idx < documentCount; idx++) {
            d = nodes[documentOffsets[idx]].getDocument();
            dlock = d.getUpdateLock();
            if (exclusive)
                {dlock.acquire(Lock.WRITE_LOCK);}
            else
                {dlock.acquire(Lock.READ_LOCK);}
        }
    }
View Full Code Here

Examples of org.geoserver.platform.resource.Resource.Lock

            return file.getName();
        }

        @Override
        public Lock lock() {
            return new Lock() {
                public void release() {
                }
            };
        }
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.