Examples of JackrabbitRepository


Examples of org.apache.jackrabbit.api.JackrabbitRepository

    public void testDataStoreGarbageCollection() throws RepositoryException {
        JackrabbitRepositoryFactory rf = new RepositoryFactoryImpl();
        Properties prop = new Properties();
        prop.setProperty("org.apache.jackrabbit.repository.home", TEST_DIR);
        prop.setProperty("org.apache.jackrabbit.repository.conf", TEST_DIR + "/repository.xml");
        JackrabbitRepository rep = (JackrabbitRepository) rf.getRepository(prop);
        RepositoryManager rm = rf.getRepositoryManager(rep);

        // need to login to start the repository
        Session session = rep.login(new SimpleCredentials("", "".toCharArray()));

        DataStoreGarbageCollector gc = rm.createDataStoreGarbageCollector();
        try {
            gc.mark();
            gc.sweep();
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

     * The repository instances that were created by this factory.
     */
    private final Set<TransientRepository> ownRepositories = new HashSet<TransientRepository>();

    public Repository getRepository(Map parameters) throws RepositoryException {
        JackrabbitRepository repo;
        synchronized (REPOSITORY_INSTANCES) {
            if (parameters == null) {
                repo = getOrCreateRepository(null, null);
            } else if (parameters.containsKey(REPOSITORY_CONF)
                    && parameters.containsKey(REPOSITORY_HOME)) {
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

     *          repository instance.
     */
    private JackrabbitRepository getOrCreateRepository(String conf,
                                                       String home)
            throws RepositoryException {
        JackrabbitRepository repo = REPOSITORY_INSTANCES.get(home);
        if (repo == null) {
            TransientRepository tr;
            if (home == null) {
                tr = new TransientRepository();
                // also remember this instance as the default repository
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

     *          repository instance.
     */
    private JackrabbitRepository getOrCreateRepository(String conf,
                                                       String home)
            throws RepositoryException {
        JackrabbitRepository repo = REPOSITORY_INSTANCES.get(home);
        if (repo == null) {
            TransientRepository tr;
            if (home == null) {
                tr = new TransientRepository();
                // also remember this instance as the default repository
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

    @AfterClass
    public static void afterAll() throws Exception {
        if (repository != null) {
            try {
                JackrabbitRepository jackrabbit = (JackrabbitRepository)repository;
                jackrabbit.shutdown();
            } finally {
                repository = null;
                // Clean up the test data ...
                FileUtil.delete(JACKRABBIT_DATA_PATH);
            }
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

                keepAliveSession.logout();
            } finally {
                keepAliveSession = null;
                if (repository != null) {
                    try {
                        JackrabbitRepository jackrabbit = (JackrabbitRepository)repository;
                        jackrabbit.shutdown();
                    } finally {
                        repository = null;
                        // Clean up the test data ...
                        FileUtil.delete(JACKRABBIT_DATA_PATH);
                    }
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

        repository = new TransientRepository(REPOSITORY_CONFIG_PATH, REPOSITORY_DIRECTORY_PATH);
    }

    static void close() {
        try {
            JackrabbitRepository jackrabbit = (JackrabbitRepository) repository;
            jackrabbit.shutdown();
        } finally {
            deleteRepoData();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

     * instance.
     */
    private static final Map<String, JackrabbitRepository> REPOSITORY_INSTANCES = new HashMap<String, JackrabbitRepository>();

    public Repository getRepository(Map parameters) throws RepositoryException {
        JackrabbitRepository repo;
        synchronized (REPOSITORY_INSTANCES) {
            if (parameters == null) {
                repo = getOrCreateRepository(null, null);
            } else if (parameters.containsKey(REPOSITORY_CONF)
                    && parameters.containsKey(REPOSITORY_HOME)) {
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

     *          repository instance.
     */
    private JackrabbitRepository getOrCreateRepository(String conf,
                                                       String home)
            throws RepositoryException {
        JackrabbitRepository repo = REPOSITORY_INSTANCES.get(home);
        if (repo == null) {
            TransientRepository tr;
            if (home == null) {
                tr = new TransientRepository();
                // also remember this instance as the default repository
View Full Code Here

Examples of org.apache.jackrabbit.api.JackrabbitRepository

    @AfterClass
    public static void afterAll() {
        if (repository != null) {
            try {
                JackrabbitRepository jackrabbit = (JackrabbitRepository)repository;
                jackrabbit.shutdown();
            } finally {
                repository = null;
                // Clean up the test data ...
                FileUtil.delete(JACKRABBIT_DATA_PATH);
            }
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.