@SuppressWarnings("unused")
PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(factory,pool,null,null,false,true);
DataSource poolingDataSource = new PoolingDataSource(pool);
new Resource(JPAPersistenceManager.WIDGET_DATABASE_JNDI_DATASOURCE_NAME, poolingDataSource);
} else if (persistenceManagerType.equals(PERSISTENCE_MANAGER_TYPE_JCR)) {
logger.info("Configuring JCR persistence manager");
// setup repository directory and derby logging properties
File repositoryDirFile = new File("widgetRepository");
if (!repositoryDirFile.exists()) {
repositoryDirFile.mkdirs();
}
String derbyLog = repositoryDirFile.getAbsolutePath()+File.separator+"derby.log";
System.setProperty("derby.stream.error.file", derbyLog);
// setup Jackrabbit JCR repository JNDI resource
String repositoryConfig = repositoryDirFile.getAbsolutePath()+File.separator+"repository.xml";
Repository repository = new TransientRepository(repositoryConfig, repositoryDirFile.getAbsolutePath());
new Resource(JCRPersistenceManager.WIDGET_REPOSITORY_JNDI_REPOSITORY_NAME, repository);
}
// configure embedded jetty web application handler
server.addHandler(context);