Dali Provisional API
Release 3.2

org.eclipse.jpt.common.core.utility.command
Interface InterruptibleJobCommand

All Known Subinterfaces:
JobCommand, NotifyingRepeatingJobCommand, RepeatingJobCommand
All Known Implementing Classes:
InterruptibleJobCommand.Interrupted, JobCommand.Disabled, JobCommand.Null, NotifyingRepeatingJobCommand.Null, RepeatingJobCommand.Null

public interface InterruptibleJobCommand

Simple interface for implementing the GOF Command design pattern in an Eclipse job and allows for the command to throw an InterruptedException.

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

See Also:
JobCommand

Nested Class Summary
static class InterruptibleJobCommand.Interrupted
          Singleton implementation of the interruptible job command interface that will throw an interrupted exception when executed.
 
Method Summary
 IStatus execute(IProgressMonitor monitor)
          Execute the command.
 

Method Detail

execute

IStatus execute(IProgressMonitor monitor)
                throws InterruptedException
Execute the command. The semantics of the command is determined by the contract between the client and server. The command should check, as appropriate, whether the specified progress monitor is "canceled"; if it is, the command should return a result status of severity IStatus.CANCEL. The singleton cancel status Status.CANCEL_STATUS can be used for this purpose.

Nested methods can also check the progress monitor and, if it is "canceled", throw an OperationCanceledException.

Throws:
InterruptedException
See Also:
IProgressMonitor.isCanceled(), Job.run(IProgressMonitor monitor)

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.