Package org.apache.jackrabbit.core

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


        // Create the repository
        try {
            RepositoryConfig config = RepositoryConfig.create(
                    configuration.getPath(), directory.getPath());
            RepositoryImpl repository = RepositoryImpl.create(config);
            try {
                Session session = repository.login(
                        new SimpleCredentials("admin", "admin".toCharArray()));
                try {
                    createTestData(session);
                } finally {
                    session.logout();
                }
            } finally {
                repository.shutdown();
            }
        } catch (RepositoryException e) {
            e.printStackTrace();
            fail("Create repository " + name);
        }
View Full Code Here


        File configuration = new File(directory, "repository.xml");

        try {
            RepositoryConfig config = RepositoryConfig.create(
                    configuration.getPath(), directory.getPath());
            RepositoryImpl repository = RepositoryImpl.create(config);
            try {
                Session session = repository.login(
                        new SimpleCredentials("admin", "admin".toCharArray()));
                try {
                    assertTestData(session);
                } finally {
                    session.logout();
                }
            } finally {
                repository.shutdown();
            }
        } catch (RepositoryException e) {
            String message = "Unable to access repository " + directory;
            log.error(message, e);
            fail(message);
View Full Code Here

     */
    public boolean execute(Context ctx) throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("stopping jackrabbit");
        }
        RepositoryImpl repo = (RepositoryImpl) CommandHelper.getRepository(ctx);
        if (repo == null) {
            throw new IllegalStateException("No current working repository");
        }
        if (!(repo instanceof RepositoryImpl)) {
            throw new IllegalStateException(
                    "Jackrabbit is not the current working repository");
        }
        repo.shutdown();
        CommandHelper.setRepository(ctx, null, null);
        return false;
    }
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(getWorkspaceName(), repo);
View Full Code Here

        BlockingParser.block();
        SearchIndex index = getSearchIndex();
        File indexDir = new File(index.getPath());

        // shutdown workspace
        RepositoryImpl repo = (RepositoryImpl) session.getRepository();
        session.logout();
        session = null;
        superuser.logout();
        superuser = null;
        TestHelper.shutdownWorkspace(getWorkspaceName(), repo);
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

   
    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

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

TOP

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

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.