public interface Submission<T>
cancel()method of a
CompletionStagedoes not cancel the
Operation. This is part of the contract of
CompletionStage. This type provides a method to cancel the
Operation. Canceling an
Operationonly makes sense after the
Operationis submitted so this type is the result of submitting an
Operation. ISSUE: Should Operation.submit return a CompletionStage with the requirement that cancel attempts to cancel the database action? Conceptually this is fine. The concern is that it requires the implementor to implement their own CompletionStage or at the least subclass CompletableFuture to override cancel. Neither of these is trivial.
|Modifier and Type||Method||Description|
Request that the
Operationnot be executed or that its execution be aborted if already begun. This is a best effort action and may not succeed in preventing or aborting the execution. This method does not block. If execution is prevented the Operation is completed exceptionally with SkippedSqlException. If the Operation is aborted it is completed exceptionally with SqlException.
CompletionStagethat has the value true if the
CompletionStagewhich value is the result of the
Operation. Any actions on the returned
cancel, have no impact on this
Operation. If this
Operationis already completed the returned
CompletionStagewill be completed. The returned
CompletionStageis completed after the Operation is completed. It may be completed by the same thread that completed the Operation or a different one. The Operation following the one that created this Submission begins execution when the Operation that created this Submission is completed. It is not required to wait for the returned CompletionStage to complete. [Note: this is necessary because the app can call this method after the Operation completes.] Each call of this method for a given
Operationreturns the same
CompletionStagefor the result of this
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
DRAFT JDBC 4.4 EA5