private boolean tryWith(AuthMethod meth) throws UserAuthException, TransportException { currentMethod = meth; result.clear(); meth.init(this); meth.request(); return result.get(timeout, TimeUnit.SECONDS); }
@Override public void reqService(Service service) throws TransportException { serviceAccept.lock(); try { serviceAccept.clear(); sendServiceRequest(service.getName()); serviceAccept.await(timeoutMs, TimeUnit.MILLISECONDS); setService(service); } finally { serviceAccept.unlock(); } }