public static class ProgressListener.ExceptionReporter extends Object implements ProgressListener, DeliveryMode
ProgressListener.ExceptionReporterDeliveryMode.CheckNOOP| 构造器和说明 |
|---|
ExceptionReporter(ProgressListener listener) |
| 限定符和类型 | 方法和说明 |
|---|---|
Throwable |
getCause()
Returns the underlying exception, if any; or null otherwise.
|
boolean |
isSyncCallSafe()
Returns true if it is safe to make a synchronous callback to the
implementing listener without the risk of incurring undue latency; false
otherwise.
|
void |
progressChanged(ProgressEvent progressEvent)
Delivers the progress event to the underlying listener but only if
there has not been an exception previously thrown by the listener.
|
void |
throwExceptionIfAny()
Throws the underlying exception, if any, as an
CosClientException; or do nothing otherwise. |
static ProgressListener.ExceptionReporter |
wrap(ProgressListener listener)
Returns a wrapper for the given listener to capture the first
exception thrown.
|
public ExceptionReporter(ProgressListener listener)
public void progressChanged(ProgressEvent progressEvent)
Called when progress has changed, such as additional bytes transferred,
transfer failed, etc. The execution of the callback of this listener is managed
by SDKProgressPublisher. Implementation of this interface
should never block.
If the implementation follows the best practice and doesn't block, it
should then extends from SyncProgressListener.
Note any exception thrown by the listener will get ignored.
Should there be need to capture any such exception, you may consider
wrapping the listener with wrap(ProgressListener).
progressChanged 在接口中 ProgressListenerprogressEvent - The event describing the progress change.SDKProgressPublisher,
ProgressListener.ExceptionReporterpublic void throwExceptionIfAny()
CosClientException; or do nothing otherwise.public Throwable getCause()
public static ProgressListener.ExceptionReporter wrap(ProgressListener listener)
public boolean isSyncCallSafe()
DeliveryModeisSyncCallSafe 在接口中 DeliveryModeCopyright © 2022. All rights reserved.