Package org.apache.jackrabbit.core

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


            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 = helper.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


    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 final Logger LOG = LoggerFactory.getLogger(GarbageCollectorTest.class);

    public void testConcurrentGC() throws Exception {
        Node root = testRootNode;
        Session session = root.getSession();
        RepositoryImpl rep = (RepositoryImpl) session.getRepository();
        if (rep.getDataStore() == null) {
            LOG.info("testConcurrentGC skipped. Data store is not used.");
            return;
        }
        final SynchronousChannel sync = new SynchronousChannel();
        final Node node = root.addNode("slowBlob");
View Full Code Here

    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;
        }

        deleteMyNodes();
View Full Code Here

    public void testTransientObjects() throws Exception {

        Node root = testRootNode;
        Session session = root.getSession();

        RepositoryImpl rep = (RepositoryImpl) session.getRepository();
        if (rep.getDataStore() == null) {
            LOG.info("testTransientObjects skipped. Data store is not used.");
            return;
        }

        deleteMyNodes();
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

     * @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

     * @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

    public void repositoryStart() throws Exception {
        InputStream config =
            RepositoryImpl.class.getResourceAsStream("repository.xml");
        String home = new File("target/cltest").getAbsolutePath();
        RepositoryConfig rc = RepositoryConfig.create(config, home);
        RepositoryImpl repository = RepositoryImpl.create(rc);

        try {
            Context ctx = getInitialContext();
            ctx.bind(REPOSITORY_NAME, repository);
        } catch (NamingException ne) {
            repository.shutdown();
            throw ne;
        }
    }
View Full Code Here

        Node testFolder = testRootNode.addNode("folder", "nt:folder");
        int num = createFiles(testFolder, 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

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.