/** * Parses the PersistenceManager config. * * @param parent parent of the <code>PersistenceManager</code> element * @return persistence manager configuration * @throws ConfigurationException if the configuration is broken */ protected PersistenceManagerConfig parsePersistenceManagerConfig( Element parent) throws ConfigurationException { return new PersistenceManagerConfig( parseBeanConfig(parent, PERSISTENCE_MANAGER_ELEMENT)); }
/** * Test that a standard workspace configuration file is * correctly parsed. * * @throws Exception on errors */ public void testWorkspaceXml() throws Exception { InputStream xml = getClass().getClassLoader().getResourceAsStream( "org/apache/jackrabbit/core/config/workspace.xml"); WorkspaceConfig config = parser.parseWorkspaceConfig(new InputSource(xml)); assertEquals("target", config.getHomeDir()); assertEquals("default", config.getName()); PersistenceManagerConfig pmc = config.getPersistenceManagerConfig(); assertEquals( "org.apache.jackrabbit.core.persistence.obj.ObjectPersistenceManager", pmc.getClassName()); assertTrue(pmc.getParameters().isEmpty()); assertTrue(config.isSearchEnabled()); WorkspaceSecurityConfig ws = config.getSecurityConfig(); if (ws != null) { BeanConfig ppfConfig = ws.getAccessControlProviderConfig(); if (ppfConfig != null) { ppfConfig.newInstance(AccessControlProvider.class); } } }
try { PersistenceManager pm = pmConfig .newInstance(PersistenceManager.class); PMContext pmContext = new PMContext( homeDir, fs, return pm; } catch (Exception e) { String msg = "Cannot instantiate persistence manager " + pmConfig.getClassName(); throw new RepositoryException(msg, e);
PersistenceManagerConfig persistenceConfig = getPersistenceManagerConf(workspaceInfo); String pmSchemaPrefix = getProperty(persistenceConfig.getParameters(), PREFIX_PROPERTY_NAME); pmSchemaPrefix = pmSchemaPrefix.toUpperCase(); Connection connection = getWsConnection(workspaceInfo);
assertEquals( "org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager", vc.getPersistenceManagerConfig().getClassName());
try { PersistenceManager pm = pmConfig .newInstance(PersistenceManager.class); PMContext pmContext = new PMContext( homeDir, fs, return pm; } catch (Exception e) { String msg = "Cannot instantiate persistence manager " + pmConfig.getClassName(); throw new RepositoryException(msg, e);
/** * Parses the PersistenceManager config. * * @param parent parent of the <code>PersistenceManager</code> element * @return persistence manager configuration * @throws ConfigurationException if the configuration is broken */ protected PersistenceManagerConfig parsePersistenceManagerConfig( Element parent) throws ConfigurationException { return new PersistenceManagerConfig( parseBeanConfig(parent, PERSISTENCE_MANAGER_ELEMENT)); }
private PersistenceManagerConfig buildPersistenceManagerConfig(){ Properties prop=new Properties(); BeanConfig beanConfig=new BeanConfig("org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager",prop); PersistenceManagerConfig persistenceManagerConfig=new PersistenceManagerConfig(beanConfig); return persistenceManagerConfig; }