} catch (NamingException e) {
throw new IllegalArgumentException("Unknown datasource " + resouceId);
}
}
JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();
if (properties.containsKey("usedatabaselock")) {
//This must be false for hsqldb
persistenceAdapter.setUseDatabaseLock(Boolean.parseBoolean(properties.getProperty("usedatabaselock", "true")));
}
persistenceAdapter.setDataSource(dataSource);
broker.setPersistenceAdapter(persistenceAdapter);
} else {
MemoryPersistenceAdapter persistenceAdapter = new MemoryPersistenceAdapter();
broker.setPersistenceAdapter(persistenceAdapter);
}