// get the connection manager
ConnectionManager connectionManager;
if ((ManagedConnectionFactory) service instanceof JdbcManagedConnectionFactory) {
connectionManager = SystemInstance.get().getComponent(ConnectionManager.class);
} else {
GeronimoConnectionManagerFactory connectionManagerFactory = new GeronimoConnectionManagerFactory();
// default transaction support is "local" and that doesn't seem to work
connectionManagerFactory.setTransactionSupport("xa");
connectionManagerFactory.setTransactionManager(transactionManager);
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader == null) classLoader = getClass().getClassLoader();
if (classLoader == null) classLoader = ClassLoader.getSystemClassLoader();
connectionManagerFactory.setClassLoader(classLoader);
connectionManager = connectionManagerFactory.create();
}
if (connectionManager == null) {
throw new RuntimeException("Invalid connection manager specified for connector identity = " + serviceInfo.id);
}