Package org.apache.jackrabbit.core.state.ISMLocking

Examples of org.apache.jackrabbit.core.state.ISMLocking.ReadLock.release()


                info = new VersionHistoryInfo(
                        history.getNodeId(),
                        history.getState().getChildNodeEntry(root, 1).getId());
            }
        } finally {
            lock.release();
        }

        if (info == null) {
            info = createVersionHistory(session, node, copiedFrom);
        }
View Full Code Here


                return versions;
            } else {
                return Collections.emptyList();
            }
        } finally {
            lock.release();
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

    public void testReadBlocksWrite() throws InterruptedException {
        ReadLock rLock = locking.acquireReadLock(state.getId());
        for (ChangeLog changeLog : logs) {
            verifyBlocked(startWriterThread(locking, changeLog));
        }
        rLock.release();
    }

    /**
     * Checks the following requirement: <p/> <i>While a write lock is held for a given change log
     * <code>C</code> an implementation must ensure that no read lock is issued for an item that is contained
View Full Code Here

        for (ChangeLog changeLog : logs) {
            WriteLock wLock = locking.acquireWriteLock(changeLog);
            verifyBlocked(startReaderThread(locking, state.getId()));
            ReadLock rLock = wLock.downgrade();
            verifyNotBlocked(startReaderThread(locking, state.getId()));
            rLock.release();
        }
    }

    // ------------------------------< utilities >-------------------------------
View Full Code Here

            }
        };
        thread.start();
        Thread.sleep(100);
        lock.acquireReadLock(null).release();
        r1.release();
        thread.join();
        if (ex[0] != null) {
            throw ex[0];
        }
    }
View Full Code Here

    public void testReadBlocksWrite() throws InterruptedException {
        ReadLock rLock = locking.acquireReadLock(state.getId());
        for (ChangeLog changeLog : logs) {
            verifyBlocked(startWriterThread(locking, changeLog));
        }
        rLock.release();
    }

    /**
     * Checks the following requirement: <p/> <i>While a write lock is held for a given change log
     * <code>C</code> an implementation must ensure that no read lock is issued for an item that is contained
View Full Code Here

        for (ChangeLog changeLog : logs) {
            WriteLock wLock = locking.acquireWriteLock(changeLog);
            verifyBlocked(startReaderThread(locking, state.getId()));
            ReadLock rLock = wLock.downgrade();
            verifyNotBlocked(startReaderThread(locking, state.getId()));
            rLock.release();
        }
    }

    // ------------------------------< utilities >-------------------------------
View Full Code Here

            NodeStateEx stateEx = new NodeStateEx(stateMgr, ntReg, state, null);
            return new InternalVersionHistoryImpl(this, stateEx);
        } catch (ItemStateException e) {
            throw new RepositoryException("Unable to make local copy", e);
        } finally {
            lock.release();
        }
    }

    /**
     * Make a local copy of an internal version item. This will recreate the
View Full Code Here

            NodeStateEx stateEx = new NodeStateEx(stateMgr, ntReg, state, null);
            return new InternalActivityImpl(this, stateEx);
        } catch (ItemStateException e) {
            throw new RepositoryException("Unable to make local copy", e);
        } finally {
            lock.release();
        }
    }

    /**
     * Return a flag indicating whether an internal version item belongs to
View Full Code Here

    public boolean hasItem(NodeId id) {
        ReadLock lock = acquireReadLock();
        try {
            return stateMgr.hasItemState(id);
        } finally {
            lock.release();
        }
    }

    /**
     * {@inheritDoc}
 
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.