Package org.scijava
Interface Cancelable
-
- All Known Subinterfaces:
ModulePreprocessor,PreprocessorPlugin,Task
- All Known Implementing Classes:
AbstractInputHarvesterPlugin,AbstractPreprocessorPlugin,AbstractSingleInputPreprocessor,ActiveDisplayPreprocessor,CheckInputsPreprocessor,CommandModule,ContextCommand,DebugPreprocessor,DefaultTask,DefaultValuePreprocessor,DynamicCommand,FileListPreprocessor,FilePreprocessor,GatewayPreprocessor,InitPreprocessor,Inputs,InteractiveCommand,LoadInputsPreprocessor,LoggerPreprocessor,ModuleCommand,OptionsPlugin,SaveInputsPreprocessor,ServicePreprocessor,UIPreprocessor,UnimplementedCommand,ValidityPreprocessor
public interface CancelableAn operation that can be canceled.- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel(String reason)Cancels the operation execution, with the given reason for doing so.StringgetCancelReason()Gets a message describing why the operation was canceled.booleanisCanceled()Gets whether the operation has been canceled.
-
-
-
Method Detail
-
isCanceled
boolean isCanceled()
Gets whether the operation has been canceled.
-
cancel
void cancel(String reason)
Cancels the operation execution, with the given reason for doing so.This method merely sets the operation status to canceled; it cannot necessarily stop the operation itself. That is, it is the responsibility of each individual operation to check
isCanceled()in a timely manner during execution, and stop doing whatever it is doing if the flag has been tripped.- Parameters:
reason- A message describing why the operation is being canceled.
-
getCancelReason
String getCancelReason()
Gets a message describing why the operation was canceled.- Returns:
- The reason for cancelation, which may be null if no reason was given, or if the operation was not in fact canceled.
-
-