Package org.apache.jackrabbit.core.util

Examples of org.apache.jackrabbit.core.util.RepositoryLock


                        BeanConfig bc =
                            parseBeanConfig(root, REPOSITORY_LOCK_MECHANISM_ELEMENT);
                        return bc.newInstance(RepositoryLockMechanism.class);
                    }
                }
                return new RepositoryLock();
            }
        };
    }
View Full Code Here


                        BeanConfig bc =
                            parseBeanConfig(root, REPOSITORY_LOCK_MECHANISM_ELEMENT);
                        return bc.newInstance(RepositoryLockMechanism.class);
                    }
                }
                return new RepositoryLock();
            }
        };
    }
View Full Code Here

                        BeanConfig bc =
                            parseBeanConfig(root, REPOSITORY_LOCK_MECHANISM_ELEMENT);
                        return bc.newInstance(RepositoryLockMechanism.class);
                    }
                }
                return new RepositoryLock();
            }
        };
    }
View Full Code Here

        boolean succeeded = false;
        try {
            this.repConfig = repConfig;

            // Acquire a lock on the repository home
            repLock = new RepositoryLock(repConfig.getHomeDir());
            repLock.acquire();

            // setup file systems
            repStore = repConfig.getFileSystemConfig().createFileSystem();
            String fsRootPath = "/meta";
View Full Code Here

                        BeanConfig bc =
                            parseBeanConfig(root, REPOSITORY_LOCK_MECHANISM_ELEMENT);
                        return bc.newInstance(RepositoryLockMechanism.class);
                    }
                }
                return new RepositoryLock();
            }
        };
    }
View Full Code Here

     * automatically removed.
     *
     * @throws RepositoryException if an error occurs
     */
    public void testNoFilesLeftBehind() throws RepositoryException {
        RepositoryLock lock = new RepositoryLock(directory.getPath());
        lock.acquire();
        lock.release();
        assertEquals(
                "Some files left behind by a lock",
                0, directory.listFiles().length);
    }
View Full Code Here

     * Tests that locking is exclusive within a single JVM.
     *
     * @throws RepositoryException if an error occurs
     */
    public void testTwoLocks() throws RepositoryException {
        RepositoryLock lockA = new RepositoryLock(directory.getPath());
        RepositoryLock lockB = new RepositoryLock(directory.getPath());
        lockA.acquire();
        try {
            lockB.acquire();
            fail("Can acquire an already acquired lock");
        } catch (RepositoryException e) {
        }
        lockA.release();
        try {
            lockB.acquire();
        } catch (RepositoryException e) {
            fail("Can not acquire a released lock");
        }
        lockB.release();
    }
View Full Code Here

     *
     * @see https://issues.apache.org/jira/browse/JCR-933
     * @throws RepositoryException
     */
    public void testCanonicalPath() throws RepositoryException {
        RepositoryLock lockA = new RepositoryLock(directory.getPath());
        lockA.acquire();
        try {
            File parent = new File(directory, "..");
            RepositoryLock lockB = new RepositoryLock(
                    new File(parent, directory.getName()).getPath());
            lockB.acquire();
            fail("Can acquire an already acquired lock using a different path");
        } catch (RepositoryException e) {
        }
        lockA.release();
    }
View Full Code Here

        log.info("Starting repository...");

        this.repConfig = repConfig;

        // Acquire a lock on the repository home
        repLock = new RepositoryLock(repConfig.getHomeDir());
        repLock.acquire();

        // setup file systems
        repStore = repConfig.getFileSystemConfig().createFileSystem();
        String fsRootPath = "/meta";
View Full Code Here

                        lock = (RepositoryLockMechanism) bc.newInstance();
                        break;
                    }
                }
                if (lock == null) {
                    lock = new RepositoryLock();
                }
                return lock;
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.util.RepositoryLock

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.