protected JBossConnection createConnectionInternal(String username, String password,
boolean isXA, int type)
throws JMSException
{
ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
try
{
tccc.set(getClass().getClassLoader());
try
{
ClientAOPStackLoader.getInstance().load(delegate);
}
catch(Exception e)
{
// Need to log message since no guarantee that client will log it
final String msg = "Failed to download and/or install client side AOP stack";
log.error(msg, e);
throw new RuntimeException(msg, e);
}
// The version used by the connection is the minimum of the server version for the
// connection factory and the client code version
CreateConnectionResult res = delegate.createConnectionDelegate(username, password, -1);
return new JBossConnection(res.getDelegate(), type);
}
finally
{
tccc.restore();
}
}