Uses of Class
java.util.concurrent.TimeUnit
| Package | Description |
|---|---|
| com.squareup.okhttp | |
| com.squareup.okhttp.internal.spdy | |
| java.util.concurrent |
Utility classes commonly useful in concurrent programming.
|
| java.util.concurrent.locks |
Interfaces and classes providing a framework for locking and waiting
for conditions that is distinct from built-in synchronization and
monitors.
|
| org.apache.http.conn |
The client-side connection management and handling API
at the heart of what is referred to as HttpConn.
|
| org.apache.http.impl.conn | |
| org.apache.http.impl.conn.tsccm |
The implementation of a thread-safe client connection manager.
|
-
Uses of TimeUnit in com.squareup.okhttp
Methods in com.squareup.okhttp with parameters of type TimeUnit Modifier and Type Method Description voidOkHttpClient. setConnectTimeout(long timeout, TimeUnit unit)Sets the default connect timeout for new connections.voidOkHttpClient. setReadTimeout(long timeout, TimeUnit unit)Sets the default read timeout for new connections. -
Uses of TimeUnit in com.squareup.okhttp.internal.spdy
Methods in com.squareup.okhttp.internal.spdy with parameters of type TimeUnit Modifier and Type Method Description longPing. roundTripTime(long timeout, TimeUnit unit)Returns the round trip time for this ping in nanoseconds, or -1 if the response was cancelled, or -2 if the timeout elapsed before the round trip completed. -
Uses of TimeUnit in java.util.concurrent
Methods in java.util.concurrent that return TimeUnit Modifier and Type Method Description static TimeUnitTimeUnit. valueOf(String name)Returns the enum constant of this type with the specified name.static TimeUnit[]TimeUnit. values()Returns an array containing the constants of this enum type, in the order they are declared.Methods in java.util.concurrent with parameters of type TimeUnit Modifier and Type Method Description booleanCountDownLatch. await(long timeout, TimeUnit unit)Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted, or the specified waiting time elapses.intCyclicBarrier. await(long timeout, TimeUnit unit)Waits until all parties have invokedawaiton this barrier, or the specified waiting time elapses.intPhaser. awaitAdvanceInterruptibly(int phase, long timeout, TimeUnit unit)Awaits the phase of this phaser to advance from the given phase value or the given timeout to elapse, throwingInterruptedExceptionif interrupted while waiting, or returning immediately if the current phase is not equal to the given phase value or this phaser is terminated.booleanExecutorService. awaitTermination(long timeout, TimeUnit unit)Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.booleanForkJoinPool. awaitTermination(long timeout, TimeUnit unit)Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.booleanThreadPoolExecutor. awaitTermination(long timeout, TimeUnit unit)longTimeUnit. convert(long sourceDuration, TimeUnit sourceUnit)Convert the given time duration in the given unit to this unit.VExchanger. exchange(V x, long timeout, TimeUnit unit)Waits for another thread to arrive at this exchange point (unless the current thread is interrupted or the specified waiting time elapses), and then transfers the given object to it, receiving its object in return.VForkJoinTask. get(long timeout, TimeUnit unit)Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.VFuture. get(long timeout, TimeUnit unit)Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.VFutureTask. get(long timeout, TimeUnit unit)longDelayed. getDelay(TimeUnit unit)Returns the remaining delay associated with this object, in the given time unit.longThreadPoolExecutor. getKeepAliveTime(TimeUnit unit)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.<T> List<Future<T>>AbstractExecutorService. invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)<T> List<Future<T>>ExecutorService. invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)Executes the given tasks, returning a list of Futures holding their status and results when all complete or the timeout expires, whichever happens first.<T> TAbstractExecutorService. invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)<T> TExecutorService. invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do before the given timeout elapses.booleanArrayBlockingQueue. offer(E e, long timeout, TimeUnit unit)Inserts the specified element at the tail of this queue, waiting up to the specified wait time for space to become available if the queue is full.booleanBlockingDeque. offer(E e, long timeout, TimeUnit unit)Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque), waiting up to the specified wait time if necessary for space to become available.booleanBlockingQueue. offer(E e, long timeout, TimeUnit unit)Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.booleanDelayQueue. offer(E e, long timeout, TimeUnit unit)Inserts the specified element into this delay queue.booleanLinkedBlockingDeque. offer(E e, long timeout, TimeUnit unit)booleanLinkedBlockingQueue. offer(E e, long timeout, TimeUnit unit)Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available.booleanLinkedTransferQueue. offer(E e, long timeout, TimeUnit unit)Inserts the specified element at the tail of this queue.booleanPriorityBlockingQueue. offer(E e, long timeout, TimeUnit unit)Inserts the specified element into this priority queue.booleanSynchronousQueue. offer(E e, long timeout, TimeUnit unit)Inserts the specified element into this queue, waiting if necessary up to the specified wait time for another thread to receive it.booleanBlockingDeque. offerFirst(E e, long timeout, TimeUnit unit)Inserts the specified element at the front of this deque, waiting up to the specified wait time if necessary for space to become available.booleanLinkedBlockingDeque. offerFirst(E e, long timeout, TimeUnit unit)booleanBlockingDeque. offerLast(E e, long timeout, TimeUnit unit)Inserts the specified element at the end of this deque, waiting up to the specified wait time if necessary for space to become available.booleanLinkedBlockingDeque. offerLast(E e, long timeout, TimeUnit unit)EArrayBlockingQueue. poll(long timeout, TimeUnit unit)EBlockingDeque. poll(long timeout, TimeUnit unit)Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), waiting up to the specified wait time if necessary for an element to become available.EBlockingQueue. poll(long timeout, TimeUnit unit)Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.Future<V>CompletionService. poll(long timeout, TimeUnit unit)Retrieves and removes the Future representing the next completed task, waiting if necessary up to the specified wait time if none are yet present.EDelayQueue. poll(long timeout, TimeUnit unit)Retrieves and removes the head of this queue, waiting if necessary until an element with an expired delay is available on this queue, or the specified wait time expires.Future<V>ExecutorCompletionService. poll(long timeout, TimeUnit unit)ELinkedBlockingDeque. poll(long timeout, TimeUnit unit)ELinkedBlockingQueue. poll(long timeout, TimeUnit unit)ELinkedTransferQueue. poll(long timeout, TimeUnit unit)EPriorityBlockingQueue. poll(long timeout, TimeUnit unit)ESynchronousQueue. poll(long timeout, TimeUnit unit)Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it.EBlockingDeque. pollFirst(long timeout, TimeUnit unit)Retrieves and removes the first element of this deque, waiting up to the specified wait time if necessary for an element to become available.ELinkedBlockingDeque. pollFirst(long timeout, TimeUnit unit)EBlockingDeque. pollLast(long timeout, TimeUnit unit)Retrieves and removes the last element of this deque, waiting up to the specified wait time if necessary for an element to become available.ELinkedBlockingDeque. pollLast(long timeout, TimeUnit unit)ScheduledFuture<?>ScheduledExecutorService. schedule(Runnable command, long delay, TimeUnit unit)Creates and executes a one-shot action that becomes enabled after the given delay.<V> ScheduledFuture<V>ScheduledExecutorService. schedule(Callable<V> callable, long delay, TimeUnit unit)Creates and executes a ScheduledFuture that becomes enabled after the given delay.ScheduledFuture<?>ScheduledThreadPoolExecutor. schedule(Runnable command, long delay, TimeUnit unit)<V> ScheduledFuture<V>ScheduledThreadPoolExecutor. schedule(Callable<V> callable, long delay, TimeUnit unit)ScheduledFuture<?>ScheduledExecutorService. scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence afterinitialDelaytheninitialDelay+period, theninitialDelay + 2 * period, and so on.ScheduledFuture<?>ScheduledThreadPoolExecutor. scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)ScheduledFuture<?>ScheduledExecutorService. scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next.ScheduledFuture<?>ScheduledThreadPoolExecutor. scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)voidThreadPoolExecutor. setKeepAliveTime(long time, TimeUnit unit)Sets the time limit for which threads may remain idle before being terminated.booleanSemaphore. tryAcquire(int permits, long timeout, TimeUnit unit)Acquires the given number of permits from this semaphore, if all become available within the given waiting time and the current thread has not been interrupted.booleanSemaphore. tryAcquire(long timeout, TimeUnit unit)Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.booleanLinkedTransferQueue. tryTransfer(E e, long timeout, TimeUnit unit)Transfers the element to a consumer if it is possible to do so before the timeout elapses.booleanTransferQueue. tryTransfer(E e, long timeout, TimeUnit unit)Transfers the element to a consumer if it is possible to do so before the timeout elapses.Constructors in java.util.concurrent with parameters of type TimeUnit Constructor Description ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)Creates a newThreadPoolExecutorwith the given initial parameters and default thread factory and rejected execution handler.ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)Creates a newThreadPoolExecutorwith the given initial parameters and default thread factory.ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)Creates a newThreadPoolExecutorwith the given initial parameters and default rejected execution handler.ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)Creates a newThreadPoolExecutorwith the given initial parameters. -
Uses of TimeUnit in java.util.concurrent.locks
Methods in java.util.concurrent.locks with parameters of type TimeUnit Modifier and Type Method Description booleanAbstractQueuedLongSynchronizer.ConditionObject. await(long time, TimeUnit unit)Implements timed condition wait.booleanAbstractQueuedSynchronizer.ConditionObject. await(long time, TimeUnit unit)Implements timed condition wait.booleanCondition. await(long time, TimeUnit unit)Causes the current thread to wait until it is signalled or interrupted, or the specified waiting time elapses.booleanLock. tryLock(long time, TimeUnit unit)Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.booleanReentrantLock. tryLock(long timeout, TimeUnit unit)Acquires the lock if it is not held by another thread within the given waiting time and the current thread has not been interrupted.booleanReentrantReadWriteLock.ReadLock. tryLock(long timeout, TimeUnit unit)Acquires the read lock if the write lock is not held by another thread within the given waiting time and the current thread has not been interrupted.booleanReentrantReadWriteLock.WriteLock. tryLock(long timeout, TimeUnit unit)Acquires the write lock if it is not held by another thread within the given waiting time and the current thread has not been interrupted. -
Uses of TimeUnit in org.apache.http.conn
Methods in org.apache.http.conn with parameters of type TimeUnit Modifier and Type Method Description voidClientConnectionManager. closeIdleConnections(long idletime, TimeUnit tunit)Closes idle connections in the pool.ManagedClientConnectionClientConnectionRequest. getConnection(long timeout, TimeUnit tunit)Obtains a connection within a given time.voidClientConnectionManager. releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit)Releases a connection for use by others.voidManagedClientConnection. setIdleDuration(long duration, TimeUnit unit)Sets the duration that this connection can remain idle before it is reused. -
Uses of TimeUnit in org.apache.http.impl.conn
Methods in org.apache.http.impl.conn with parameters of type TimeUnit Modifier and Type Method Description voidIdleConnectionHandler. add(HttpConnection connection, long validDuration, TimeUnit unit)Registers the given connection with this handler.voidSingleClientConnManager. closeIdleConnections(long idletime, TimeUnit tunit)voidSingleClientConnManager. releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit)voidAbstractClientConnAdapter. setIdleDuration(long duration, TimeUnit unit) -
Uses of TimeUnit in org.apache.http.impl.conn.tsccm
Methods in org.apache.http.impl.conn.tsccm with parameters of type TimeUnit Modifier and Type Method Description voidAbstractConnPool. closeIdleConnections(long idletime, TimeUnit tunit)Closes idle connections.voidThreadSafeClientConnManager. closeIdleConnections(long idleTimeout, TimeUnit tunit)abstract voidAbstractConnPool. freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit)Returns an entry into the pool.voidConnPoolByRoute. freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit)BasicPoolEntryAbstractConnPool. getEntry(HttpRoute route, Object state, long timeout, TimeUnit tunit)Obtains a pool entry with a connection within the given timeout.protected BasicPoolEntryConnPoolByRoute. getEntryBlocking(HttpRoute route, Object state, long timeout, TimeUnit tunit, WaitingThreadAborter aborter)Obtains a pool entry with a connection within the given timeout.BasicPoolEntryPoolEntryRequest. getPoolEntry(long timeout, TimeUnit tunit)Obtains a pool entry with a connection within the given timeout.voidThreadSafeClientConnManager. releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit)