public class ProgressListenerChain extends Object implements ProgressListener, DeliveryMode
This class could be used for both Amazon S3 and Amazon Glacier clients. The legacy Amazon S3 progress listener chain com.amazonaws.services.s3.transfer.internal.ProgressListenerChain has been deprecated in favor of this new class.
ProgressListener.ExceptionReporter, ProgressListener.NoOpProgressListener
DeliveryMode.Check
NOOP
Constructor and Description |
---|
ProgressListenerChain(ProgressEventFilter progressEventFilter,
ProgressListener... listeners)
Create a listener chain with a ProgressEventFilter.
|
ProgressListenerChain(ProgressListener... listeners)
Create a listener chain that directly passes all the progress events to
the specified listeners.
|
Modifier and Type | Method and Description |
---|---|
void |
addProgressListener(ProgressListener listener) |
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)
Called when progress has changed, such as additional bytes transferred,
transfer failed, etc.
|
void |
removeProgressListener(ProgressListener listener) |
public ProgressListenerChain(ProgressListener... listeners)
public ProgressListenerChain(ProgressEventFilter progressEventFilter, ProgressListener... listeners)
public void addProgressListener(ProgressListener listener)
public void removeProgressListener(ProgressListener listener)
public void progressChanged(ProgressEvent progressEvent)
ProgressListener
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 ProgressListener.ExceptionReporter.wrap(ProgressListener)
.
progressChanged
in interface ProgressListener
progressEvent
- The event describing the progress change.SDKProgressPublisher
,
ProgressListener.ExceptionReporter
public boolean isSyncCallSafe()
DeliveryMode
isSyncCallSafe
in interface DeliveryMode