String name = UUIDGenerator.getInstance().generateStringUUID();
boolean retry = false;
do
{
Version clientVersion = VersionLoader.getVersion();
Lock lock = null;
try
{
Channel channel1;
synchronized (failoverLock)
{
if (connection == null)
{
throw new IllegalStateException("Connection is null");
}
channel1 = connection.getChannel(1, -1);
// Lock it - this must be done while the failoverLock is held
channel1.getLock().lock();
lock = channel1.getLock();
} // We can now release the failoverLock
// We now set a flag saying createSession is executing
synchronized (exitLock)
{
inCreateSession = true;
}
long sessionChannelID = connection.generateChannelID();
Packet request = new CreateSessionMessage(name,
sessionChannelID,
clientVersion.getIncrementingVersion(),
username,
password,
serverLocator.getMinLargeMessageSize(),
xa,
autoCommitSends,