Package org.exist.storage.lock

Examples of org.exist.storage.lock.Lock.acquire()


        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


            d = nodes[documentOffsets[idx]].getDocument();
            dlock = d.getUpdateLock();
            if (exclusive)
                {dlock.acquire(Lock.WRITE_LOCK);}
            else
                {dlock.acquire(Lock.READ_LOCK);}
        }
    }

    public void unlock(boolean exclusive) {
        sort();
View Full Code Here

            d = (DocumentImpl)values[idx];
            dlock = d.getUpdateLock();
            //if (checkExisting && dlock.hasLock(thread))
                //continue;
            if(exclusive)
                {dlock.acquire(Lock.WRITE_LOCK);}
            else
                {dlock.acquire(Lock.READ_LOCK);}
        }
    }
View Full Code Here

            //if (checkExisting && dlock.hasLock(thread))
                //continue;
            if(exclusive)
                {dlock.acquire(Lock.WRITE_LOCK);}
            else
                {dlock.acquire(Lock.READ_LOCK);}
        }
    }

    @Override
    public void unlock(boolean exclusive) {
View Full Code Here

    }

    public void lock(DBBroker broker, boolean exclusive, boolean checkExisting) throws LockException {
        final Lock dlock = doc.getUpdateLock();
        if (exclusive)
            {dlock.acquire(Lock.WRITE_LOCK);}
        else
            {dlock.acquire(Lock.READ_LOCK);}
    }

    public void unlock(boolean exclusive) {
View Full Code Here

    public void lock(DBBroker broker, boolean exclusive, boolean checkExisting) throws LockException {
        final Lock dlock = doc.getUpdateLock();
        if (exclusive)
            {dlock.acquire(Lock.WRITE_LOCK);}
        else
            {dlock.acquire(Lock.READ_LOCK);}
    }

    public void unlock(boolean exclusive) {
        final Lock dlock = doc.getUpdateLock();
        if(exclusive)
View Full Code Here

    public void sync() throws DBException {
        if (btree == null)
            {return;}
        final Lock lock = btree.getLock();
        try {
            lock.acquire(Lock.WRITE_LOCK);
            btree.flush();
        } catch (final LockException e) {
            LOG.warn("Failed to acquire lock for '" + btree.getFile().getName() + "'", e);
            //TODO : throw an exception ? -pb
        } catch (final DBException e) {
View Full Code Here

    public Object run() {
        final Lock lock = file.getLock();
        try {
            // try to acquire a lock on the file
            try {
                lock.acquire( mode );
            } catch( final LockException e ) {
                System.out.println("Failed to acquire read lock on " + file.getFile().getName());
                return null;
            }
            file.setOwnerObject(ownerObject);
View Full Code Here

            //TODO : is this ever called ? -pb
            if (data.size() == 0)
                {return;}
            final Lock lock = dbTokens.getLock();
            try {
                lock.acquire(Lock.WRITE_LOCK);
                Value key;
                if (currentSection == QNAME_SECTION) {
                    final QNameTerm term = (QNameTerm) token;
                    key = new QNameWordRef(collectionId, term.qname, term.term,
                        broker.getBrokerPool().getSymbols());
View Full Code Here

                    } else {
                        key = new WordRef(collectionId, token.toString());
                    }
                    os.clear();
                    try {
                        lock.acquire(Lock.WRITE_LOCK);
                        boolean changed = false;
                        os.clear();
                        final VariableByteInput is = dbTokens.getAsStream(key);
                        //Does the token already has data in the index ?
                        if (is == null)
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.