/** * Returns the thread keep-alive time, which is the amount of time * that threads in excess of the core pool size may remain * idle before being terminated. * * @param unit the desired time unit of the result * @return the time limit * @see #setKeepAliveTime */ public long getKeepAliveTime(TimeUnit unit) { return unit.convert(keepAliveTime, TimeUnit.NANOSECONDS); }
/** * Returns the thread keep-alive time, which is the amount of time * that threads in excess of the core pool size may remain * idle before being terminated. * * @param unit the desired time unit of the result * @return the time limit * @see #setKeepAliveTime */ public long getKeepAliveTime(TimeUnit unit) { return unit.convert(keepAliveTime, TimeUnit.NANOSECONDS); }
/** * Returns the thread keep-alive time, which is the amount of time * that threads in excess of the core pool size may remain * idle before being terminated. * * @param unit the desired time unit of the result * @return the time limit * @see #setKeepAliveTime */ public long getKeepAliveTime(TimeUnit unit) { return unit.convert(keepAliveTime, TimeUnit.NANOSECONDS); }
public long getDelay(TimeUnit unit) { long d = unit.convert(time - now(), TimeUnit.NANOSECONDS); return d; }
public long getDelay(TimeUnit unit) { long d = unit.convert(time - now(), TimeUnit.NANOSECONDS); return d; }
public Message receive(long timeout, TimeUnit unit) throws JMSException { long millis = unit.convert(timeout, TimeUnit.MILLISECONDS); return getConsumer().receive(millis); }
public long getDelay(TimeUnit unit) { long d = unit.convert(time - now(), TimeUnit.NANOSECONDS); return d; }
long msecs = granularity.convert(timeout, TimeUnit.MILLISECONDS); long startTime = msecs >= 0 ? System.currentTimeMillis(): 0; long waitTime = msecs;
public synchronized Object get(long timeout, TimeUnit tunit) throws InterruptedException, ExecutionException, TimeoutException { waitFor(tunit.convert(timeout, TimeUnit.MILLISECONDS)); if (!completed) { throw new TimeoutException("Timeout when waiting for a result"); } return getResult(); }
if (timeout == 0) return false; long msecs = granularity.convert(timeout, TimeUnit.MILLISECONDS); long startTime = msecs >= 0 ? System.currentTimeMillis(): 0; long waitTime = msecs;
long msecs = granularity.convert(timeout, TimeUnit.MILLISECONDS); long startTime = msecs >= 0 ? System.currentTimeMillis(): 0; long waitTime = msecs;
public boolean await(long timeout, TimeUnit unit) throws InterruptedException { long millis = unit.convert(timeout, TimeUnit.MILLISECONDS); lock.lock(); try { // oneway server.await(id, listener, millis); if (signalledThread == Thread.currentThread()) { signalledThread = null; } else { localCondition.await(); } } finally { lock.unlock(); } return false; }