public class DownloadListenerPromise extends java.lang.Object implements Success<java.io.File,java.lang.Void>, Failure
RepositoryPlugin| Constructor and Description |
|---|
DownloadListenerPromise(Reporter reporter,
java.lang.String task,
Promise<java.io.File> promise,
RepositoryPlugin.DownloadListener... downloadListeners)
Use the promise to signal the Download Listeners
|
public DownloadListenerPromise(Reporter reporter, java.lang.String task, Promise<java.io.File> promise, RepositoryPlugin.DownloadListener... downloadListeners)
reporter - a reporter or null (will use a SLF4 in that case)task - promise - downloadListeners - public Promise<java.lang.Void> call(Promise<java.io.File> resolved) throws java.lang.Exception
SuccessThis method is called if the Promise with which it is registered resolves successfully.
In the remainder of this description we will refer to the Promise
returned by this method as the returned Promise and the Promise returned
by Promise.then(Success) when this Success callback was
registered as the chained Promise.
If the returned Promise is null then the chained Promise must
resolve immediately with a successful value of null. If the
returned Promise is not null then the chained Promise must be
resolved when the returned Promise is resolved.
call in interface Success<java.io.File,java.lang.Void>resolved - The successfully resolved Promise.null if the chained Promise is to be resolved immediately
with the value null.java.lang.Exception - The chained Promise must be failed with the thrown
exception.public void fail(Promise<?> resolved) throws java.lang.Exception
FailureThis method is called if the Promise with which it is registered resolves with a failure.
In the remainder of this description we will refer to the Promise
returned by Promise.then(Success, Failure) when this Failure
callback was registered as the chained Promise.
If this methods completes normally, the chained Promise must be failed with the same exception which failed the resolved Promise. If this method throws an exception, the chained Promise must be failed with the thrown exception.
public java.lang.String toString()
toString in class java.lang.Objectpublic void linkTo(java.io.File linked)
Copyright (c) aQute SARL (2000, 2017) and others. All Rights Reserved.