saker.build Documentation TaskDoc JavaDoc Packages
public interface TaskDependencyFuture<R>
Represents a handle to a specified task to query the result from.

This interface allows fine-grained dependency reporting for a given task. It should not be reused and is considered to be private to the user. The difference between this and TaskFuture is that instances of this should not be reused by different parts of client code.

The method setTaskOutputChangeDetector(TaskOutputChangeDetector) can be used to specify a custom output change detector for the input task.

Instances of this interface should be used by only a single thread. Method calls should not overlap.

Instances of this interface is usually obtained from TaskFuture.asDependencyFuture() or TaskContext.getTaskDependencyFuture(TaskIdentifier).

Methods of this class may throw (but not required in all cases) IllegalTaskOperationException if it detects that they are being called after the caller task execution has finished. References to task dependency futures should not be retained after the task execution is over.

Clients should not implement this interface.

RThe return type of the task.
Methods
public TaskDependencyFuture<R>
Clones the dependency future object, returning a clean one.
public R
get()
Retrieves the result of the associated task execution.
public R
Retrieves the result of the associated task, given that it is already finished.
public Object
Gets the modification stamp of the subject task.
public TaskContext
Gets the task context which was used to retrieve this dependency future.
public TaskIdentifier
Gets the task identifier of the subject task.
public void
Sets the output change detector for the subject task dependency.
public abstract TaskDependencyFuture<R> clone()
Clones the dependency future object, returning a clean one.

The returned dependency future is semantically the same as if a new one was directly retrieved using TaskContext.getTaskDependencyFuture(TaskIdentifier). (Or TaskFuture.asDependencyFuture().)

The cloned dependency future.
Retrieves the result of the associated task execution.

This call will wait for the task if necessary and report an input dependency on it.

The output change detector for the reported task dependency will be CommonTaskOutputChangeDetector.ALWAYS by default. It can be replaced if the client calls setTaskOutputChangeDetector(TaskOutputChangeDetector) after or before calling this function.

If this method throws a TaskExecutionFailedException, it is considered to be a valid return scenario. A dependency on the the associated task will be installed as if a return value was returned.

Callers should handle the possiblity of tasks returning StructuredTaskResult instances.

The result of the subject task.
TaskResultWaitingFailedExceptionIf the waiting failed. See exception subclasses for possible scenarios.
TaskExecutionFailedExceptionIf the subject task execution failed, this exception is thrown
IllegalTaskOperationExceptionIf the current task is not allowed to wait for the subject task. See exception message for more information.
Retrieves the result of the associated task, given that it is already finished.

The output change detector for the reported task dependency will be CommonTaskOutputChangeDetector.ALWAYS by default. It can be replaced if the client calls setTaskOutputChangeDetector(TaskOutputChangeDetector) after or before calling this function.

Important: See TaskFuture.getFinished() for the requirements for calling this method.

Callers should handle the possiblity of tasks returning StructuredTaskResult instances.

The result of the subject task.
TaskExecutionFailedExceptionIf the subject task execution failed, this exception is thrown
IllegalTaskOperationExceptionIf the current task is not allowed to retrieve the result for the subject task, or the subject task hasn't finished yet.
Gets the modification stamp of the subject task.

See TaskFuture.getModificationStamp() for documentation.

The current modification stamp for the subject task.
IllegalTaskOperationExceptionIf the current task is not allowed to retrieve the result for the subject task, or the subject task hasn't finished yet.
Gets the task context which was used to retrieve this dependency future.
The task context.
Gets the task identifier of the subject task.
The task identifier.
Sets the output change detector for the subject task dependency.

If the task dependency was not yet reported this task, this method reports it. The output change detector will be applied for this particular dependency on the task.

If the build runtime detects a change in the task output, the caller task will be rerun with an appropriate delta.

This method can be called more than once to add multiple change detectors.

outputchangedetectorThe output change detector.
IllegalStateExceptionIf the task has not yet finished.
NullPointerExceptionIf the change detector is null.