/*
(non-Javadoc)

@see com.ibm.wsspi.uow.UOWManager#getUOWTimeout()
511989
@Override
    public int getUOWTimeout() throws IllegalStateException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "getUOWTimeout", this);

        final int timeout;
        final int uowType = getUOWType();

        switch (uowType) {
            case UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION:
                try {
                    timeout = ((EmbeddableTransactionImpl) getUOWScope()).getTimeout();
                } catch (SystemException e) {
                    final IllegalStateException ise = new IllegalStateException(e);
                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        Tr.exit(tc, "getUOWTimeout", ise);
                    throw ise;
                }
                break;

            default:
                final IllegalStateException ise = new IllegalStateException("Invalid UOW type: " + uowType);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    Tr.exit(tc, "getUOWTimeout", ise);
                throw ise;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "getUOWTimeout", new Integer(timeout));
        return timeout;
    }
1054110
private static int getTimeout(final Ticket ticket) {
        val ttl = ticket.getExpirationPolicy().getTimeToLive().intValue();
        if (ttl == 0) {
            return 1;
        }
        return ttl;
    }
317798
public Integer getTimeout()
   {
      if (childNode.getTextValueForPatternName("timeout") != null && !childNode.getTextValueForPatternName("timeout").equals("null")) {
         return Integer.valueOf(childNode.getTextValueForPatternName("timeout"));
      }
      return null;
   }
356487
@Override
    public long getHiddenExpiryTime()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(tc, "getHiddenExpiryTime");
            SibTr.exit(tc, "getHiddenExpiryTime", Long.valueOf(hiddenExpiryTime));
        }
        return hiddenExpiryTime;
    }
845848
public Timeout getTimeoutLeft()
	{
		final long left = getTimeLeft();

		if (left != 0)
			return new Timeout(left, TimeUnit.MILLISECONDS);
		else
			return Timeout.ZERO;
	}
583524
protected IOException newTimeoutException(IOException cause) {
    InterruptedIOException e = new InterruptedIOException("timeout");
    if (cause != null) {
      e.initCause(cause);
    }
    return e;
  }
709359
@Override
  public ExtensionProcessor getLogoutProcessor()
  {
      //do not cache the processor in the webcontainer code, always return the result from security
      IWebAppSecurityCollaborator secCollab = this.collabHelper.getSecurityCollaborator();
      logoutProcessor = secCollab.getFormLogoutExtensionProcessor(this);

      return logoutProcessor;
  }
386044
public final CompletionStage<V> getOrTimeout(Duration timeout, ScheduledExecutorService timeoutExecutor) {

        if (GATE_UPDATER.get(this) == GATE_OPEN && timeoutScheduleFuture == null) {
            this.timeoutScheduleFuture = timeoutExecutor.schedule(this::emit, timeout.toNanos(), TimeUnit.NANOSECONDS);
        }

        return selfFuture;
    }
680945
public static UOWManager getUOWManager()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getUOWManager");

        final UOWManager uowm = com.ibm.ws.uow.embeddable.UOWManagerFactory.getUOWManager();

        if (tc.isEntryEnabled())
            Tr.exit(tc, "getUOWManager", uowm);
        return uowm;
    }
1287602
public List<AroundTimeoutType<MessageDrivenBeanType<T>>> getAllAroundTimeout()
   {
      List<AroundTimeoutType<MessageDrivenBeanType<T>>> list = new ArrayList<AroundTimeoutType<MessageDrivenBeanType<T>>>();
      List<Node> nodeList = childNode.get("around-timeout");
      for(Node node: nodeList)
      {
         AroundTimeoutType<MessageDrivenBeanType<T>>  type = new AroundTimeoutTypeImpl<MessageDrivenBeanType<T>>(this, "around-timeout", childNode, node);
         list.add(type);
      }
      return list;
   }
1350652
public long getDuration(TimeUnit targetUnit) {
        if (isRunning()) {
            throw new IllegalStateException("The clock is not yet stopped.");
        }
        return targetUnit.convert(durationNanos, TimeUnit.NANOSECONDS);
    }
316452
@Override
  public long getDuration() {
    final long end = running.get() ? System.nanoTime() : endTime.get();
    return end - startTime.get();
  }
643012
public long timeout()
    {
        final long now = now();
        for (Entry<Timer, Long> entry : entries()) {
            final Timer timer = entry.getKey();
            final Long expiration = entry.getValue();

            if (timer.alive) {
                //  Live timer, lets return the timeout
                if (expiration - now > 0) {
                    return expiration - now;
                }
                else {
                    return 0;
                }
            }

            //  Remove it from the list of active timers.
            timers.remove(expiration, timer);
        }
        //  Wait forever as no timers are alive
        return -1;
    }
178737
public T fadeOut() {
        if (view!=null) {
            view.startAnimation(AnimationUtils.loadAnimation(context,android.R.anim.fade_out));
        }
        return self();
    }
620148
@Override
    public IPromise<T> onTimeout(Consumer timeoutHandler) {
        return then( (r,e) -> {
            if ( e == Timeout.INSTANCE ) {
                timeoutHandler.accept(e);
            }
        });
    }
1236530
@Override
	public CompletableFuture<Acknowledge> cancel(Time timeout) {
		executionGraph.cancel();

		return CompletableFuture.completedFuture(Acknowledge.get());
	}
1214970
public long getFirstTimeout()
    {
        long lastTimeout = Math.max(System.currentTimeMillis(), start); // d666295

        // If we're already past the end date, then there is no timeout.
        if (lastTimeout > end)
        {
            return -1;
        }

        return getTimeout(lastTimeout, false);
    }