connectionManager.setPassword(connectionConfig.getPassword());
if (connectionConfig.getSession().size() > 0) {
SessionManager sessionManager;
DestinationManager destinationManager;
SessionConfig sessionConfig = connectionConfig.getSession().get(0);
if (jndiFactory != null) {
jndiFactory._setDelegateClassLoader(classLoader);
destinationManager = new JNDIDestinationManager(jndiFactory._getProperties(), true);
sessionManager = new ThreadLocalSessionManager(sessionConfig, destinationManager);
} else {
destinationManager = new SimpleDestinationManager();
sessionManager = new ThreadLocalSessionManager(sessionConfig, destinationManager);
}
log.debug("SESSION IS " + sessionConfig.getId());
if (sessionConfig.getReconnects() != null) {
sessionManager.setReconnects(sessionConfig.getReconnects().intValue());
}
classLoaderManager.putClassLoaderByHermes(sessionConfig.getId(), classLoader);
factoryConfigById.put(sessionConfig.getId(), factoryConfig);
sessionManager.setTransacted(sessionConfig.isTransacted());
sessionManager.setId(sessionConfig.getId());
sessionManager.setFactoryConfig(factoryConfig);
sessionManager.setAudit(sessionConfig.isAudit());
sessionManager.setParent(connectionManager);
connectionManager.setParent(connectionFactoryManager);
if (config.getAuditDirectory() != null) {
sessionManager.setAuditDirectory(config.getAuditDirectory());
} else if (sessionConfig.getAuditDirectory() != null) {
sessionManager.setAuditDirectory(sessionConfig.getAuditDirectory());
}
connectionManager.addChild(sessionManager);
hermes = new DefaultHermesImpl(factoryConfig.getExtension(), sessionManager, classLoader);