Top Description Methods
jdk.internal.net.http.common

public Interface Cancelable

Known Direct Implementers
jdk.internal.net.http.MultiExchange, jdk.internal.net.http.MultiExchange.CancelableRef
Annotations
@FunctionalInterface

A functional interface that allows to request cancellation of a task - which may or may not have already started.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

false if the task could not be cancelled, typically because it has already completed normally; true otherwise
cancel
(boolean
true if an attempt to stop the task should be made even if the task has already started; otherwise, in-progress tasks are allowed to complete.
mayInterruptIfRunning
)

Attempts to cancel execution of a task.

Method Detail

cancelback to summary
public boolean cancel(boolean mayInterruptIfRunning)

Attempts to cancel execution of a task. This attempt may not succeed if the task has already completed, has already been cancelled, or could not be cancelled for some other reason.

Parameters
mayInterruptIfRunning:boolean

true if an attempt to stop the task should be made even if the task has already started; otherwise, in-progress tasks are allowed to complete.

Returns:boolean

false if the task could not be cancelled, typically because it has already completed normally; true otherwise