Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.RepositoryImpl$WorkspaceJanitor


    }

    private Repository registerStatistics(Repository repository) {
        if (repository instanceof RepositoryImpl) {
            try {
                RepositoryImpl repositoryImpl = (RepositoryImpl) repository;
                StatisticsMBeanImpl mbean = new StatisticsMBeanImpl(repositoryImpl);
                Dictionary<String, Object> properties = new Hashtable<String, Object>();
                String mbeanName = StatisticsMBeanImpl.getMBeanName(repositoryImpl);
                properties.put("jmx.objectname", mbeanName);
                properties.put(Constants.SERVICE_VENDOR, "Apache");
View Full Code Here


                IOUtils.copy(repoConfig, out);
                out.close();
                repoConfig.close();
                config = RepositoryConfig.create(source);
            }
            RepositoryImpl repository = RepositoryImpl.create(config);
            try {
                createSourceContent(repository);
            } finally {
                repository.shutdown();
            }
            NodeStore target = new KernelNodeStore(new MicroKernelImpl());
            RepositoryUpgrade.copy(source, target);
            targetRepository = new Jcr(new Oak(target)).createRepository();
        }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        RepositoryImpl repo = (RepositoryImpl) superuser.getRepository();
        String wspName = repo.getConfig().getSecurityConfig().getSecurityManagerConfig().getWorkspaceName();

        s = getHelper().getSuperuserSession(wspName);
        provider = new UserAccessControlProvider();
        provider.init(s, Collections.emptyMap());
    }
View Full Code Here

                } finally {
                    output.close();
                }

                // Create the repository
                RepositoryImpl repository = createRepository(dir, xml);
                try {
                    // Run the test
                    DescriptiveStatistics statistics = runTest(test, repository);
                    if (statistics.getN() > 0) {
                        writeReport(test.toString(), name, statistics);
                    }
                } finally {
                    repository.shutdown();
                }
            } catch (Throwable t) {
                System.out.println(
                        "Unable to run " + test + ": " + t.getMessage());
            } finally {
View Full Code Here

        String text = "the quick brown fox jumps over the lazy dog.";
        int num = createFiles(testFolder, text.getBytes(ENCODING), 10, 2, 0);
        session.save();

        // shutdown workspace
        RepositoryImpl repo = (RepositoryImpl) session.getRepository();
        session.logout();
        session = null;
        superuser.logout();
        superuser = null;
        TestHelper.shutdownWorkspace(WORKSPACE_NAME, repo);
View Full Code Here

     * @param session the session that created this object
     * @param list the persistence managers
     * @param sessionList the sessions to access the workspaces
     */
    public GarbageCollector(SessionImpl session, IterablePersistenceManager[] list, Session[] sessionList) {
        RepositoryImpl rep = (RepositoryImpl) session.getRepository();
        store = rep.getDataStore();
        this.pmList = list;
        this.persistenceManagerScan = list != null;
        this.sessionList = sessionList;

        // Auto-close if the main session logs out
View Full Code Here

    private static final Logger LOG = LoggerFactory.getLogger(GCConcurrentTest.class);

    public void testGC() throws Exception {
        Node root = testRootNode;
        Session session = root.getSession();
        RepositoryImpl rep = (RepositoryImpl) session.getRepository();
        if (rep.getDataStore() == null) {
            LOG.info("testGC skipped. Data store is not used.");
            return;
        }
        GCThread gc = new GCThread(session);
        Thread gcThread = new Thread(gc, "Datastore Garbage Collector");
View Full Code Here

    private static Logger log = LoggerFactory.getLogger(TestTwoGetStreams.class);

    private static final int STREAM_LENGTH = 256 * 1024;

    private boolean isDataStoreEnabled() throws RepositoryException {
        RepositoryImpl rep = (RepositoryImpl) superuser.getRepository();
        return rep.getDataStore() != null;
    }
View Full Code Here

            log("Test skipped. Required repository class: "
                    + RepositoryImpl.class + " got: " + rep.getClass());
            return;
        }

        RepositoryImpl r = (RepositoryImpl) rep;
        RepositoryConfig conf = r.getConfig();
        Collection<WorkspaceConfig> coll = conf.getWorkspaceConfigs();
        String[] names = new String[coll.size()];
        Iterator<WorkspaceConfig> wspIt = coll.iterator();
        for (int i = 0; wspIt.hasNext(); i++) {
            WorkspaceConfig wsc = (WorkspaceConfig) wspIt.next();
            names[i] = wsc.getName();
        }

        for (int i = 0; i < names.length && i < 1; i++) {
            Session s = getHelper().getSuperuserSession(names[i]);
            try {
                Method m = r.getClass().getDeclaredMethod("getWorkspaceInfo", new Class[] { String.class });
                m.setAccessible(true);
                Object info = m.invoke(r, names[i]);
                m = info.getClass().getDeclaredMethod("getPersistenceManager", new Class[0]);
                m.setAccessible(true);
                PersistenceManager pm = (PersistenceManager) m.invoke(info, new Object[0]);
View Full Code Here

            log("Test skipped. Required repository class: "
                    + RepositoryImpl.class + " got: " + rep.getClass());
            return;
        }

        RepositoryImpl r = (RepositoryImpl) rep;
        RepositoryConfig conf = r.getConfig();
        Collection<WorkspaceConfig> coll = conf.getWorkspaceConfigs();
        String[] names = new String[coll.size()];
        Iterator<WorkspaceConfig> wspIt = coll.iterator();
        for (int i = 0; wspIt.hasNext(); i++) {
            WorkspaceConfig wsc = wspIt.next();
            names[i] = wsc.getName();
        }

        for (int i = 0; i < names.length && i < 1; i++) {
            Session s = getHelper().getSuperuserSession(names[i]);
            try {
                Method m = r.getClass().getDeclaredMethod("getWorkspaceInfo", new Class[] { String.class });
                m.setAccessible(true);
                Object info = m.invoke(r, names[i]);
                m = info.getClass().getDeclaredMethod("getPersistenceManager", new Class[0]);
                m.setAccessible(true);
                PersistenceManager pm = (PersistenceManager) m.invoke(info, new Object[0]);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.RepositoryImpl$WorkspaceJanitor

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.