@Override public Lock lockSessionCreation() { try { Lock localFailoverLock = factoryInternal.lockFailover(); try { if (connection == null) { return null; } Lock lock = getChannel1().getLock(); // Lock it - this must be done while the failoverLock is held while (isAlive() && !lock.tryLock(100, TimeUnit.MILLISECONDS)) { } return lock; } finally { localFailoverLock.unlock(); } // We can now release the failoverLock } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
@Override public Lock lockSessionCreation() { try { Lock localFailoverLock = factoryInternal.lockFailover(); try { if (connection == null) { return null; } Lock lock = getChannel1().getLock(); // Lock it - this must be done while the failoverLock is held while (isAlive()) { if (lock.tryLock(100, TimeUnit.MILLISECONDS)) { return lock; } } return null; } finally { localFailoverLock.unlock(); } // We can now release the failoverLock } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
@Override public Lock lockSessionCreation() { try { Lock localFailoverLock = factoryInternal.lockFailover(); try { if (connection == null) { return null; } Lock lock = getChannel1().getLock(); // Lock it - this must be done while the failoverLock is held while (isAlive() && !lock.tryLock(100, TimeUnit.MILLISECONDS)) { } return lock; } finally { localFailoverLock.unlock(); } // We can now release the failoverLock } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
@Override public Lock lockSessionCreation() { try { Lock localFailoverLock = factoryInternal.lockFailover(); try { if (connection == null) { return null; } Lock lock = getChannel1().getLock(); // Lock it - this must be done while the failoverLock is held while (isAlive() && !lock.tryLock(100, TimeUnit.MILLISECONDS)) { } return lock; } finally { localFailoverLock.unlock(); } // We can now release the failoverLock } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
@Override public Lock lockSessionCreation() { try { Lock localFailoverLock = factoryInternal.lockFailover(); try { if (connection == null) { return null; } Lock lock = getChannel1().getLock(); // Lock it - this must be done while the failoverLock is held while (isAlive() && !lock.tryLock(100, TimeUnit.MILLISECONDS)) { } return lock; } finally { localFailoverLock.unlock(); } // We can now release the failoverLock } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
@Override public Lock lockSessionCreation() { try { Lock localFailoverLock = factoryInternal.lockFailover(); try { if (connection == null) { return null; } Lock lock = getChannel1().getLock(); // Lock it - this must be done while the failoverLock is held while (isAlive()) { if (lock.tryLock(100, TimeUnit.MILLISECONDS)) { return lock; } } return null; } finally { localFailoverLock.unlock(); } // We can now release the failoverLock } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
@Override public Lock lockSessionCreation() { try { Lock localFailoverLock = factoryInternal.lockFailover(); try { if (connection == null) { return null; } Lock lock = getChannel1().getLock(); // Lock it - this must be done while the failoverLock is held while (isAlive()) { if (lock.tryLock(100, TimeUnit.MILLISECONDS)) { return lock; } } return null; } finally { localFailoverLock.unlock(); } // We can now release the failoverLock } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }