Search in sources :

Example 1 with PMContext

use of org.apache.jackrabbit.core.persistence.PMContext in project jackrabbit by apache.

the class RepositoryImpl method createPersistenceManager.

/**
     * Creates a workspace persistence manager based on the given
     * configuration. The persistence manager is instantiated using
     * information in the given persistence manager configuration and
     * initialized with a persistence manager context containing the other
     * arguments.
     *
     * @return the created workspace persistence manager
     * @throws RepositoryException if the persistence manager could
     *                             not be instantiated/initialized
     */
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);
    }
}
Also used : PersistenceManager(org.apache.jackrabbit.core.persistence.PersistenceManager) IterablePersistenceManager(org.apache.jackrabbit.core.persistence.IterablePersistenceManager) RepositoryException(javax.jcr.RepositoryException) PMContext(org.apache.jackrabbit.core.persistence.PMContext) NoSuchWorkspaceException(javax.jcr.NoSuchWorkspaceException) FileSystemException(org.apache.jackrabbit.core.fs.FileSystemException) ClusterException(org.apache.jackrabbit.core.cluster.ClusterException) AccessDeniedException(javax.jcr.AccessDeniedException) IOException(java.io.IOException) LoginException(javax.jcr.LoginException) TransactionException(org.apache.jackrabbit.data.core.TransactionException) RepositoryException(javax.jcr.RepositoryException) DataStoreException(org.apache.jackrabbit.core.data.DataStoreException) ItemStateException(org.apache.jackrabbit.core.state.ItemStateException)

Aggregations

IOException (java.io.IOException)1 AccessDeniedException (javax.jcr.AccessDeniedException)1 LoginException (javax.jcr.LoginException)1 NoSuchWorkspaceException (javax.jcr.NoSuchWorkspaceException)1 RepositoryException (javax.jcr.RepositoryException)1 ClusterException (org.apache.jackrabbit.core.cluster.ClusterException)1 DataStoreException (org.apache.jackrabbit.core.data.DataStoreException)1 FileSystemException (org.apache.jackrabbit.core.fs.FileSystemException)1 IterablePersistenceManager (org.apache.jackrabbit.core.persistence.IterablePersistenceManager)1 PMContext (org.apache.jackrabbit.core.persistence.PMContext)1 PersistenceManager (org.apache.jackrabbit.core.persistence.PersistenceManager)1 ItemStateException (org.apache.jackrabbit.core.state.ItemStateException)1 TransactionException (org.apache.jackrabbit.data.core.TransactionException)1