// Do not allow the broker to use a shutown hook, the kernel will stop it
brokerService.setUseShutdownHook(isUseShutdownHook());
// Setup the persistence adapter to use the right datasource and directory
DefaultPersistenceAdapterFactory persistenceFactory = (DefaultPersistenceAdapterFactory) brokerService.getPersistenceFactory();
persistenceFactory.setDataDirectoryFile(serverInfo.resolveServer(dataDirectory));
persistenceFactory.setDataSource((DataSource) dataSource.$getResource());
brokerService.start();
}
finally {
Thread.currentThread().setContextClassLoader(old);