// Wait until the session is either accepted or declined (terminated).
lock.lock();
try {
if (!condition.await(timeout, TimeUnit.MILLISECONDS)) {
throw new NoResponseException("The receiver did not respond in time.");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} finally {
lock.unlock();