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);
}