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