/*
(non-Javadoc)
@see javax.sip.SipListener#processTimeout(javax.sip.TimeoutEvent)
327413
public void processTimeout(TimeoutEvent timeoutEvent) {
        Transaction transaction = null;
        if(timeoutEvent.isServerTransaction()) {
            transaction = timeoutEvent.getServerTransaction();
            if(logger.isDebugEnabled()) {
                logger.debug("timeout => " + transaction.getRequest().toString());
            }
        } else {
            transaction = timeoutEvent.getClientTransaction();
            if(logger.isDebugEnabled()) {
                logger.debug("timeout => " + transaction.getRequest().toString());
            }
        }
        String callId = ((CallIdHeader)transaction.getRequest().getHeader(CallIdHeader.NAME)).getCallId();
        register.unStickSessionFromNode(callId);
    }
81726
public void processResponse(ResponseEvent response) {
    ClientTransaction trans = response.getClientTransaction();
    if (trans == null) {
      return;
    }

    SipTransaction sip_trans = null;

    synchronized (respTransactions) {
      sip_trans = (SipTransaction) respTransactions.get(trans);
    }

    if (sip_trans == null) {
      return;
    }

    if (response.getResponse().getStatusCode() > 199) {
      synchronized (respTransactions) {
        respTransactions.remove(trans);
      }
    }

    // check for listener handling
    MessageListener listener = sip_trans.getClientListener();
    if (listener != null) {
      listener.processEvent(response);
      return;
    }

    // if no listener, use the default blocking mechanism
    synchronized (sip_trans.getBlock()) {
      sip_trans.getEvents().addLast(response);
      sip_trans.getBlock().notifyEvent();
    }
  }
148981
private void waitForCallback(final String uuid, final long timeout) throws TimeoutException {

		synchronized (lock) {

			this.message = null;
			this.hasTimeout = true;

			try {
				lock.wait(timeout);

			} catch (InterruptedException iex) {
				logger.warn("", iex);
			}

			// remove timed out callback
			if (this.hasTimeout) {

				peer.unregisterCallback(uuid);
				throw new TimeoutException();
			}
		}
	}
592637
public void setResponseTimeout(int timeout) {
        try {
            getConnection().setReadTimeout(timeout);
        } catch (Exception e) {
            Modbus.log().warning(e.getLocalizedMessage());
        }
    }
507302
@Override
    public void onDialogTimeout(MAPDialog mapDialog) {
        logger.error(String.format("onDialogTimeout for DialogId=%d", mapDialog.getLocalDialogId()));
    }
1359958
public String invoke(String message, int timeoutSeconds)
    throws ProcessException {
        try {
            HttpHelper httpHelper = new HttpHelper(getURL(destination));
            httpHelper.getConnection().setReadTimeout(timeoutSeconds * 1000);
            httpHelper.getConnection().setConnectTimeout(timeoutSeconds * 1000);
            String res = httpHelper.post(message);
            return res==null?null:res.trim();
        } catch (Exception e) {
            throw new ProcessException(-1, e.getMessage(), e);
        }
    }
1016956
public AndroidInstallApplicationOptions withTimeout(Duration timeout) {
        checkArgument(!checkNotNull(timeout).isNegative(), "The timeout value cannot be negative");
        this.timeout = timeout;
        return this;
    }
138450
private void checkTimeoutSession() {
        if(appLastSeen <= 0) return;
        long now = System.currentTimeMillis();
        if ((now - appLastSeen) > Constants.SESSION_LENGTH_MINS * 60 * 1000) {
            getConfigLogger().verbose(getAccountId(), "Session Timed Out");
            destroySession();
            setCurrentActivity(null);
        }
    }
88934
@Override
    public void onInvokeTimeout(MAPDialog mapDialog, Long invokeId) {
        logger.error(String.format("onInvokeTimeout for Dialog=%d and invokeId=%d", mapDialog.getLocalDialogId(), invokeId));

    }
874877
public void processOpen(String method, URL url, String origin, boolean async, long connectTimeout) throws Exception {
        LOG.entering(CLASS_NAME, "processOpen", new Object[] {method, url, origin, async});

        this.async = async;
        connection = (HttpURLConnection)url.openConnection();
        connection.setRequestMethod(method);
        connection.setInstanceFollowRedirects(false);
        connection.setConnectTimeout((int) connectTimeout);

        if (!origin.equalsIgnoreCase("null") && !origin.startsWith("privileged")) {
            URL originUrl = new URL(origin);
            origin = originUrl.getProtocol() + "://" + originUrl.getAuthority();
        }

        // connection.addRequestProperty("X-Origin", origin);
        connection.addRequestProperty("Origin", origin);
        setReadyState(State.OPENED);

        listener.opened(new OpenEvent());
    }
877346
public void setScanTimeout(int timeout) {
        scanTimeout = timeout;
        Log.i(TAG, String.format("New scan timeout set: %d seconds", scanTimeout));
    }
198067
public String invoke(String message, int timeoutSeconds)
    throws ProcessException {
        try {
            return JMSServices.getInstance().invoke(destination,
                    JMSDestinationNames.INTRA_MDW_EVENT_HANDLER_QUEUE, message, timeoutSeconds);
        } catch (Exception e) {
            throw new ProcessException(-1, e.getMessage(), e);
        }
    }
1295053
synchronized void stop(Integer timeout) {
        final InternalState required = this.requiredState;
        if(required != InternalState.STOPPED) {
            this.requiredState = InternalState.STOPPED;
            ROOT_LOGGER.stoppingServer(serverName);
            // Only send the stop operation if the server is started
            if (internalState == InternalState.SERVER_STARTED) {
                internalSetState(new ServerStopTask(timeout), internalState, InternalState.PROCESS_STOPPING);
            } else {
                transition(false);
            }
        }
    }
144701
private long determineTimeout() {

        long timeout = getReceiveTimeout();

        JmsResourceHolder resourceHolder = (JmsResourceHolder) TransactionSynchronizationManager
                .getResource(getConnectionFactory());
        if (resourceHolder != null && resourceHolder.hasTimeout()) {
            timeout = Math.min(timeout, resourceHolder.getTimeToLiveInMillis());
        }
        return timeout;
    }
138770
void timeout() {
    long time = System.currentTimeMillis();
    Iterator<Map.Entry<Long, ContextualFuture>> iterator = responseFutures.entrySet().iterator();
    while (iterator.hasNext()) {
      ContextualFuture future = iterator.next().getValue();
      if (future.time + requestTimeout < time) {
        iterator.remove();
        future.context.executor().execute(() -> future.completeExceptionally(new TimeoutException("request timed out")));
      } else {
        break;
      }
    }
  }
1161547
public static int waitForWithTimeout(final Process p, long timeout, TimeUnit unit)
      throws TimeoutException {

    ProcessThread t = new ProcessThread(p);
    t.start();
    try {
      unit.timedJoin(t, timeout);

    } catch (InterruptedException e) {
      t.interrupt();
      Thread.currentThread().interrupt();
    }

    if (!t.hasFinished()) {
      throw new TimeoutException("Process did not finish within timeout");
    }

    return t.exitValue();
  }
947805
public void setTimeout(Duration timeout) {

        LettuceAssert.notNull(timeout, "Timeout duration must not be null");
        LettuceAssert.isTrue(!timeout.isNegative(), "Timeout duration must be greater or equal to zero");

        this.timeout = timeout;

        if (channelWriter instanceof CommandExpiryWriter) {
            ((CommandExpiryWriter) channelWriter).setTimeout(timeout);
        }
    }