Package org.apache.jackrabbit.core.lock

Examples of org.apache.jackrabbit.core.lock.LockManager


            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            Lock lock = lockMgr.lock(this, isDeep, isSessionScoped);

            boolean succeeded = false;

            try {
                // add properties to content
                internalSetProperty(QName.JCR_LOCKOWNER,
                        InternalValue.create(getSession().getUserID()));
                internalSetProperty(QName.JCR_LOCKISDEEP,
                        InternalValue.create(isDeep));
                save();
                succeeded = true;
            } finally {
                if (!succeeded) {
                    // failed to set lock meta-data content, cleanup
                    try {
                        lockMgr.unlock(this);
                        refresh(false);
                    } catch (RepositoryException re) {
                        // cleanup failed
                        log.error("error while cleaning up after failed lock attempt", re);
                    }
View Full Code Here


            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            if (lockMgr.holdsLock(this)) {
                // save first, and unlock later. this guards concurrent access

                // remove properties in content
                internalSetProperty(QName.JCR_LOCKOWNER, (InternalValue) null);
                internalSetProperty(QName.JCR_LOCKISDEEP, (InternalValue) null);
                save();
            }
            lockMgr.unlock(this);
        }
    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            Lock lock = lockMgr.lock(this, isDeep, isSessionScoped);

            boolean succeeded = false;

            try {
                // add properties to content
                internalSetProperty(QName.JCR_LOCKOWNER,
                        InternalValue.create(getSession().getUserID()));
                internalSetProperty(QName.JCR_LOCKISDEEP,
                        InternalValue.create(isDeep));
                save();
                succeeded = true;
            } finally {
                if (!succeeded) {
                    // failed to set lock meta-data content, cleanup
                    try {
                        lockMgr.unlock(this);
                        refresh(false);
                    } catch (RepositoryException re) {
                        // cleanup failed
                        log.error("error while cleaning up after failed lock attempt", re);
                    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            if (lockMgr.isLockHolder(session, this)) {
                // save first, and unlock later. this guards concurrent access

                // remove properties in content
                internalSetProperty(QName.JCR_LOCKOWNER, (InternalValue) null);
                internalSetProperty(QName.JCR_LOCKISDEEP, (InternalValue) null);
                save();
            }
            lockMgr.unlock(this);
        }
    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            Lock lock = lockMgr.lock(this, isDeep, isSessionScoped);

            boolean succeeded = false;

            try {
                // add properties to content
                internalSetProperty(QName.JCR_LOCKOWNER,
                        InternalValue.create(getSession().getUserID()));
                internalSetProperty(QName.JCR_LOCKISDEEP,
                        InternalValue.create(isDeep));
                save();
                succeeded = true;
            } finally {
                if (!succeeded) {
                    // failed to set lock meta-data content, cleanup
                    try {
                        lockMgr.unlock(this);
                        refresh(false);
                    } catch (RepositoryException re) {
                        // cleanup failed
                        log.error("error while cleaning up after failed lock attempt", re);
                    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            if (lockMgr.isLockHolder(session, this)) {
                // save first, and unlock later. this guards concurrent access

                // remove properties in content
                internalSetProperty(QName.JCR_LOCKOWNER, (InternalValue) null);
                internalSetProperty(QName.JCR_LOCKISDEEP, (InternalValue) null);
                save();
            }
            lockMgr.unlock(this);
        }
    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            Lock lock = lockMgr.lock(this, isDeep, isSessionScoped);

            boolean succeeded = false;

            try {
                // add properties to content
                internalSetProperty(QName.JCR_LOCKOWNER,
                        InternalValue.create(getSession().getUserID()));
                internalSetProperty(QName.JCR_LOCKISDEEP,
                        InternalValue.create(isDeep));
                save();
                succeeded = true;
            } finally {
                if (!succeeded) {
                    // failed to set lock meta-data content, cleanup
                    try {
                        lockMgr.unlock(this);
                        refresh(false);
                    } catch (RepositoryException re) {
                        // cleanup failed
                        log.error("error while cleaning up after failed lock attempt", re);
                    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            if (lockMgr.holdsLock(this)) {
                // save first, and unlock later. this guards concurrent access

                // remove properties in content
                internalSetProperty(QName.JCR_LOCKOWNER, (InternalValue) null);
                internalSetProperty(QName.JCR_LOCKISDEEP, (InternalValue) null);
                save();
            }
            lockMgr.unlock(this);
        }
    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            Lock lock = lockMgr.lock(this, isDeep, isSessionScoped);

            // add properties to content
            internalSetProperty(QName.JCR_LOCKOWNER,
                    InternalValue.create(getSession().getUserID()));
            internalSetProperty(QName.JCR_LOCKISDEEP,
View Full Code Here

            throw new InvalidItemStateException(msg);
        }

        checkLockable();

        LockManager lockMgr = session.getLockManager();
        synchronized (lockMgr) {
            lockMgr.unlock(this);

            // remove properties in content
            internalSetProperty(QName.JCR_LOCKOWNER, (InternalValue) null);
            internalSetProperty(QName.JCR_LOCKISDEEP, (InternalValue) null);
            save();
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.lock.LockManager

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.