Uses of Interface
java.lang.Runnable
Packages that use Runnable
Package
Description
Contains all of the classes for creating user interfaces and for painting
graphics and images.
Provides interfaces and classes for dealing with different types of events
fired by AWT components.
Provides classes and interfaces for producing rendering-independent images.
Provides classes that are fundamental to the design of the Java
programming language.
Provides reference-object classes, which support a limited degree
of interaction with the garbage collector.
Contains the collections framework, some internationalization support classes,
a service loader, properties, random number generation, string parsing
and scanning classes, base64 encoding and decoding, a bit array, and
several miscellaneous utility classes.
Utility classes commonly useful in concurrent programming.
Provides the classes and interfaces of
the Java 2 platform's core logging facilities.
Classes to support functional-style operations on streams of elements, such
as map-reduce transformations on collections.
Provides classes for the secure socket package.
Provides a set of "lightweight" (all-Java language) components
that, to the maximum degree possible, work the same on all platforms.
Provides classes and interfaces that deal with editable and noneditable text
components.
This package provides classes to create events and control Flight Recorder.
This package contains classes for consuming Flight Recorder data.
This package contains classes to control and monitor Flight Recorder over Java Management Extensions (JMX).
-
Uses of Runnable in java.awt
Modifier and TypeMethodDescriptionstatic voidEventQueue.invokeAndWait(Runnable runnable) static voidEventQueue.invokeLater(Runnable runnable) -
Uses of Runnable in java.awt.event
Fields in java.awt.event declared as RunnableModifier and TypeFieldDescriptionprotected RunnableInvocationEvent.runnableThe Runnable whose run() method will be called.Constructors in java.awt.event with parameters of type RunnableModifierConstructorDescriptionprotectedInvocationEvent(Object source, int id, Runnable runnable, Object notifier, boolean catchThrowables) Constructs anInvocationEventwith the specified source and ID which will execute the runnable'srun()method when dispatched.InvocationEvent(Object source, Runnable runnable) Constructs anInvocationEventwith the specified source which will execute the runnable'srun()method when dispatched.InvocationEvent(Object source, Runnable runnable, Object notifier, boolean catchThrowables) Constructs anInvocationEventwith the specified source which will execute the runnable'srun()method when dispatched.InvocationEvent(Object source, Runnable runnable, Runnable listener, boolean catchThrowables) Constructs anInvocationEventwith the specified source which will execute the runnable'srun()method when dispatched. -
Uses of Runnable in java.awt.image.renderable
Classes in java.awt.image.renderable that implement RunnableModifier and TypeClassDescriptionclassAn adapter class that implements ImageProducer to allow the asynchronous production of a RenderableImage. -
Uses of Runnable in java.lang
Modifier and TypeMethodDescriptionvoidRuns an operation with each scoped value in this mapping bound to its value in the current thread.static <T> voidScopedValue.runWhere(ScopedValuePREVIEW<T> key, T value, Runnable op) Run an operation with aScopedValuebound to a value in the current thread.Creates a newThreadfrom the current state of the builder and schedules it to execute.static ThreadThread.startVirtualThread(Runnable task) Creates a virtual thread to execute a task and schedules it to execute.Creates a newThreadfrom the current state of the builder to run the given task.ModifierConstructorDescriptionInitializes a new platformThread.Initializes a new platformThread.Thread(ThreadGroup group, Runnable task) Initializes a new platformThread.Thread(ThreadGroup group, Runnable task, String name) Initializes a new platformThreadso that it hastaskas its run object, has the specifiednameas its name, and belongs to the thread group referred to bygroup.Thread(ThreadGroup group, Runnable task, String name, long stackSize) Initializes a new platformThreadso that it hastaskas its run object, has the specifiednameas its name, and belongs to the thread group referred to bygroup, and has the specified stack size.Thread(ThreadGroup group, Runnable task, String name, long stackSize, boolean inheritInheritableThreadLocals) Initializes a new platformThreadso that it hastaskas its run object, has the specifiednameas its name, belongs to the thread group referred to bygroup, has the specifiedstackSize, and inherits initial values for inheritable thread-local variables ifinheritThreadLocalsistrue. -
Uses of Runnable in java.lang.ref
Methods in java.lang.ref with parameters of type RunnableModifier and TypeMethodDescriptionRegisters an object and a cleaning action to run when the object becomes phantom reachable. -
Uses of Runnable in java.util
Modifier and TypeClassDescriptionclassA task that can be scheduled for one-time or repeated execution by aTimer.Modifier and TypeMethodDescriptionvoidOptional.ifPresentOrElse(Consumer<? super T> action, Runnable emptyAction) If a value is present, performs the given action with the value, otherwise performs the given empty-based action.voidOptionalDouble.ifPresentOrElse(DoubleConsumer action, Runnable emptyAction) If a value is present, performs the given action with the value, otherwise performs the given empty-based action.voidOptionalInt.ifPresentOrElse(IntConsumer action, Runnable emptyAction) If a value is present, performs the given action with the value, otherwise performs the given empty-based action.voidOptionalLong.ifPresentOrElse(LongConsumer action, Runnable emptyAction) If a value is present, performs the given action with the value, otherwise performs the given empty-based action. -
Uses of Runnable in java.util.concurrent
Subinterfaces of Runnable in java.util.concurrentClasses in java.util.concurrent that implement RunnableModifier and TypeClassDescriptionclassA thread managed by aForkJoinPool, which executesForkJoinTasks.classFutureTask<V>A cancellable asynchronous computation.Methods in java.util.concurrent that return types with arguments of type RunnableModifier and TypeMethodDescriptionScheduledThreadPoolExecutor.getQueue()Returns the task queue used by this executor.ThreadPoolExecutor.getQueue()Returns the task queue used by this executor.ExecutorService.shutdownNow()Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.ForkJoinPool.shutdownNow()Possibly attempts to cancel and/or stop all tasks, and reject all subsequently submitted tasks.ScheduledThreadPoolExecutor.shutdownNow()Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.ThreadPoolExecutor.shutdownNow()Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.Methods in java.util.concurrent with parameters of type RunnableModifier and TypeMethodDescriptionstatic ForkJoinTask<?> Returns a newForkJoinTaskthat performs therunmethod of the givenRunnableas its action, and returns a null result uponForkJoinTask.join().static <T> ForkJoinTask<T> Returns a newForkJoinTaskthat performs therunmethod of the givenRunnableas its action, and returns the given result uponForkJoinTask.join().protected voidThreadPoolExecutor.afterExecute(Runnable r, Throwable t) Method invoked upon completion of execution of the given Runnable.protected voidThreadPoolExecutor.beforeExecute(Thread t, Runnable r) Method invoked prior to executing the given Runnable in the given thread.Returns aCallableobject that, when called, runs the given task and returnsnull.static <T> Callable<T> Returns aCallableobject that, when called, runs the given task and returns the given result.protected <V> RunnableScheduledFuture<V> ScheduledThreadPoolExecutor.decorateTask(Runnable runnable, RunnableScheduledFuture<V> task) Modifies or replaces the task used to execute a runnable.voidExecutes the given command at some time in the future.voidvoidExecutescommandwith zero required delay.voidExecutes the given task sometime in the future.protected <T> RunnableFuture<T> AbstractExecutorService.newTaskFor(Runnable runnable, T value) Returns aRunnableFuturefor the given runnable and default value.Constructs a new unstartedThreadto run the given runnable.voidRejectedExecutionHandler.rejectedExecution(Runnable r, ThreadPoolExecutor executor) Method that may be invoked by aThreadPoolExecutorwhenexecutecannot accept a task.voidThreadPoolExecutor.AbortPolicy.rejectedExecution(Runnable r, ThreadPoolExecutor e) Always throws RejectedExecutionException.voidThreadPoolExecutor.CallerRunsPolicy.rejectedExecution(Runnable r, ThreadPoolExecutor e) Executes task r in the caller's thread, unless the executor has been shut down, in which case the task is discarded.voidThreadPoolExecutor.DiscardOldestPolicy.rejectedExecution(Runnable r, ThreadPoolExecutor e) Obtains and ignores the next task that the executor would otherwise execute, if one is immediately available, and then retries execution of task r, unless the executor is shut down, in which case task r is instead discarded.voidThreadPoolExecutor.DiscardPolicy.rejectedExecution(Runnable r, ThreadPoolExecutor e) Does nothing, which has the effect of discarding task r.booleanRemoves this task from the executor's internal queue if it is present, thus causing it not to be run if it has not already started.CompletableFuture.runAfterBoth(CompletionStage<?> other, Runnable action) CompletionStage.runAfterBoth(CompletionStage<?> other, Runnable action) Returns a new CompletionStage that, when this and the other given stage both complete normally, executes the given action.CompletableFuture.runAfterBothAsync(CompletionStage<?> other, Runnable action) CompletableFuture.runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) CompletionStage.runAfterBothAsync(CompletionStage<?> other, Runnable action) Returns a new CompletionStage that, when this and the other given stage both complete normally, executes the given action using this stage's default asynchronous execution facility.CompletionStage.runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) Returns a new CompletionStage that, when this and the other given stage both complete normally, executes the given action using the supplied executor.CompletableFuture.runAfterEither(CompletionStage<?> other, Runnable action) CompletionStage.runAfterEither(CompletionStage<?> other, Runnable action) Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action.CompletableFuture.runAfterEitherAsync(CompletionStage<?> other, Runnable action) CompletableFuture.runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) CompletionStage.runAfterEitherAsync(CompletionStage<?> other, Runnable action) Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action using this stage's default asynchronous execution facility.CompletionStage.runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action using the supplied executor.static CompletableFuture<Void> Returns a new CompletableFuture that is asynchronously completed by a task running in theForkJoinPool.commonPool()after it runs the given action.static CompletableFuture<Void> Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action.Submits a one-shot task that becomes enabled after the given delay.ScheduledExecutorService.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) Submits a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is, executions will commence afterinitialDelay, theninitialDelay + period, theninitialDelay + 2 * period, and so on.ScheduledThreadPoolExecutor.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) Submits a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is, executions will commence afterinitialDelay, theninitialDelay + period, theninitialDelay + 2 * period, and so on.ScheduledExecutorService.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) Submits 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.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) Submits 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.Future<?> <T> Future<T> Submits a Runnable task for execution and returns a Future representing that task.Future<?> Submits a Runnable task for execution and returns a Future representing that task.<T> Future<T> Submits a Runnable task for execution and returns a Future representing that task.ForkJoinTask<?> <T> ForkJoinTask<T> Future<?> <T> Future<T> Returns a new CompletionStage that, when this stage completes normally, executes the given action.CompletableFuture.thenRunAsync(Runnable action) CompletableFuture.thenRunAsync(Runnable action, Executor executor) CompletionStage.thenRunAsync(Runnable action) Returns a new CompletionStage that, when this stage completes normally, executes the given action using this stage's default asynchronous execution facility.CompletionStage.thenRunAsync(Runnable action, Executor executor) Returns a new CompletionStage that, when this stage completes normally, executes the given action using the supplied Executor.Constructors in java.util.concurrent with parameters of type RunnableModifierConstructorDescriptionCyclicBarrier(int parties, Runnable barrierAction) Creates a newCyclicBarrierthat will trip when the given number of parties (threads) are waiting upon it, and which will execute the given barrier action when the barrier is tripped, performed by the last thread entering the barrier.FutureTask(Runnable runnable, V result) Creates aFutureTaskthat will, upon running, execute the givenRunnable, and arrange thatgetwill return the given result on successful completion.Constructor parameters in java.util.concurrent with type arguments of type RunnableModifierConstructorDescriptionThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) Creates a newThreadPoolExecutorwith the given initial parameters, the default thread factory and the default 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 the 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 the 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 Runnable in java.util.logging
Methods in java.util.logging with parameters of type RunnableModifier and TypeMethodDescriptionLogManager.addConfigurationListener(Runnable listener) Adds a configuration listener to be invoked each time the logging configuration is read.voidLogManager.removeConfigurationListener(Runnable listener) Removes a previously registered configuration listener. -
Uses of Runnable in java.util.stream
Methods in java.util.stream with parameters of type Runnable -
Uses of Runnable in javax.net.ssl
Methods in javax.net.ssl that return RunnableModifier and TypeMethodDescriptionabstract RunnableSSLEngine.getDelegatedTask()Returns a delegatedRunnabletask for thisSSLEngine. -
Uses of Runnable in javax.swing
Classes in javax.swing that implement RunnableModifier and TypeClassDescriptionclassSwingWorker<T,V> An abstract class to perform lengthy GUI-interaction tasks in a background thread.Methods in javax.swing with parameters of type RunnableModifier and TypeMethodDescriptionstatic voidSwingUtilities.invokeAndWait(Runnable doRun) CausesdoRun.run()to be executed synchronously on the AWT event dispatching thread.static voidSwingUtilities.invokeLater(Runnable doRun) Causes doRun.run() to be executed asynchronously on the AWT event dispatching thread. -
Uses of Runnable in javax.swing.text
Classes in javax.swing.text that implement RunnableModifier and TypeClassDescriptionclassA record representing the layout state of a child view.Methods in javax.swing.text that return RunnableModifier and TypeMethodDescriptionprotected RunnableLayoutQueue.waitForWork()Used by the worker thread to get a new task to execute.Methods in javax.swing.text with parameters of type RunnableModifier and TypeMethodDescriptionvoidAdd a task that is not needed immediately because the results are not believed to be visible.voidThis allows the model to be safely rendered in the presence of currency, if the model supports being updated asynchronously.voidAllows the model to be safely rendered in the presence of concurrency, if the model supports being updated asynchronously. -
Uses of Runnable in jdk.jfr
Modifier and TypeMethodDescriptionstatic voidFlightRecorder.addPeriodicEvent(Class<? extends Event> eventClass, Runnable hook) Adds a hook for a periodic event.static booleanFlightRecorder.removePeriodicEvent(Runnable hook) Removes a hook for a periodic event. -
Uses of Runnable in jdk.jfr.consumer
Methods in jdk.jfr.consumer with parameters of type RunnableModifier and TypeMethodDescriptionvoidRegisters an action to perform when the stream is closed.voidvoidRegisters an action to perform after the stream has been flushed.void -
Uses of Runnable in jdk.management.jfr
Methods in jdk.management.jfr with parameters of type Runnable