Package org.apache.jackrabbit.core.persistence

Examples of org.apache.jackrabbit.core.persistence.PersistenceManager


        // Copy all the default workspace content
        RepositoryConfig config = source.getRepositoryConfig();
        String name = config.getDefaultWorkspaceName();

        PersistenceManager pm =
                source.getWorkspaceInfo(name).getPersistenceManager();
        NamespaceRegistryImpl nr = source.getNamespaceRegistry();

        NodeState state = new JackrabbitNodeState(pm, nr, ROOT_NODE_ID);
        for (PropertyState property : state.getProperties()) {
View Full Code Here


        Repository r = session.getRepository();
        if (!(r instanceof RepositoryImpl)) {
            throw new NotExecutableException();
        } else {
            RepositoryImpl ri = (RepositoryImpl) r;
            PersistenceManager pm = ri.getWorkspaceInfo(
                    session.getWorkspace().getName()).getPersistenceManager();
            if (!(pm instanceof ConsistencyChecker)) {
                throw new NotExecutableException();
            } else {
                return ((ConsistencyChecker) pm).check(null, true, runFix);
View Full Code Here

        Repository r = session.getRepository();
        if (!(r instanceof RepositoryImpl)) {
            throw new NotExecutableException();
        } else {
            RepositoryImpl ri = (RepositoryImpl) r;
            PersistenceManager pm = ri.getRepositoryContext()
                    .getInternalVersionManager().getPersistenceManager();
            if (!(pm instanceof ConsistencyChecker)) {
                throw new NotExecutableException();
            } else {
                return ((ConsistencyChecker) pm).check(null, true, runFix);
View Full Code Here

                                                      DelegatingObservationDispatcher delegatingDispatcher)
            throws RepositoryException {


        FileSystem fs = vConfig.getFileSystem();
        PersistenceManager pm = createPersistenceManager(
                vConfig.getHomeDir(), fs,
                vConfig.getPersistenceManagerConfig());

        ISMLocking ismLocking = vConfig.getISMLocking();
View Full Code Here

     */
    private PersistenceManager createPersistenceManager(
            File homeDir, FileSystem fs, PersistenceManagerConfig pmConfig)
            throws RepositoryException {
        try {
            PersistenceManager pm = pmConfig
                    .newInstance(PersistenceManager.class);
            PMContext pmContext = new PMContext(
                    homeDir, fs,
                    context.getRootNodeId(),
                    context.getNamespaceRegistry(),
                    context.getNodeTypeRegistry(),
                    context.getDataStore(),
                    context.getRepositoryStatistics());
            pm.init(pmContext);
            return pm;
        } catch (Exception e) {
            String msg = "Cannot instantiate persistence manager " + pmConfig.getClassName();
            throw new RepositoryException(msg, e);
        }
View Full Code Here

     */
    public GarbageCollector createDataStoreGarbageCollector()
            throws RepositoryException {
        ArrayList<PersistenceManager> pmList = new ArrayList<PersistenceManager>();
        InternalVersionManagerImpl vm = context.getInternalVersionManager();
        PersistenceManager pm = vm.getPersistenceManager();
        pmList.add(pm);
        String[] wspNames = getWorkspaceNames();
        Session[] sessions = new Session[wspNames.length];
        for (int i = 0; i < wspNames.length; i++) {
            String wspName = wspNames[i];
View Full Code Here

                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]);
                if (!(pm instanceof AbstractBundlePersistenceManager)) {
                    log("PM skipped: " + pm.getClass());
                    continue;
                }
                AbstractBundlePersistenceManager apm = (AbstractBundlePersistenceManager) pm;
                log("PM: " + pm.getClass().getName());

                log("All nodes in one step");
                NodeId after = null;
                NodeId first = null;
                for (NodeId id : apm.getAllNodeIds(null, 0)) {
View Full Code Here

                                                      DelegatingObservationDispatcher delegatingDispatcher)
            throws RepositoryException {


        FileSystem fs = vConfig.getFileSystem();
        PersistenceManager pm = createPersistenceManager(vConfig.getHomeDir(),
                fs,
                vConfig.getPersistenceManagerConfig(),
                rootNodeId,
                nsReg,
                ntReg,
View Full Code Here

                                                               NamespaceRegistry nsReg,
                                                               NodeTypeRegistry ntReg,
                                                               DataStore dataStore)
            throws RepositoryException {
        try {
            PersistenceManager pm = pmConfig.newInstance(PersistenceManager.class);
            pm.init(new PMContext(homeDir, fs, rootNodeId, nsReg, ntReg, dataStore));
            return pm;
        } catch (Exception e) {
            String msg = "Cannot instantiate persistence manager " + pmConfig.getClassName();
            throw new RepositoryException(msg, e);
        }
View Full Code Here

    private void copyVersionStore(
            NodeBuilder root, Map<Integer, String> idxToPrefix)
            throws RepositoryException, IOException {
        logger.info("Copying version histories");

        PersistenceManager pm =
                source.getInternalVersionManager().getPersistenceManager();
        NamespaceRegistry nr =source.getNamespaceRegistry();

        NodeBuilder system = root.child(JCR_SYSTEM);
        system.setChildNode(JCR_VERSIONSTORAGE, new JackrabbitNodeState(
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.persistence.PersistenceManager

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.