|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sonatype.aether.transfer.AbstractTransferListener
org.sonatype.aether.util.listener.ChainedTransferListener
public class ChainedTransferListener
A transfer listener that delegates to zero or more other listeners (multicast). The list of target listeners is thread-safe, i.e. target listeners can be added or removed by any thread at any time.
Constructor Summary | |
---|---|
ChainedTransferListener(java.util.Collection<TransferListener> listeners)
Creates a new multicast listener that delegates to the specified listeners. |
|
ChainedTransferListener(TransferListener... listeners)
Creates a new multicast listener that delegates to the specified listeners. |
Method Summary | |
---|---|
void |
add(java.util.Collection<TransferListener> listeners)
Adds the specified listeners to the end of the multicast chain. |
void |
add(TransferListener listener)
Adds the specified listener to the end of the multicast chain. |
protected void |
handleError(TransferEvent event,
TransferListener listener,
java.lang.RuntimeException error)
|
void |
remove(TransferListener listener)
Removes the specified listener from the multicast chain. |
void |
transferCorrupted(TransferEvent event)
Notifies the listener that a checksum validation failed. |
void |
transferFailed(TransferEvent event)
Notifies the listener about the unsuccessful termination of a transfer. |
void |
transferInitiated(TransferEvent event)
Notifies the listener about the initiation of a transfer. |
void |
transferProgressed(TransferEvent event)
Notifies the listener about some progress in the data transfer. |
void |
transferStarted(TransferEvent event)
Notifies the listener about the start of a data transfer, i.e. |
void |
transferSucceeded(TransferEvent event)
Notifies the listener about the successful completion of a transfer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChainedTransferListener(TransferListener... listeners)
listeners
- The listeners to delegate to, may be null
or empty.public ChainedTransferListener(java.util.Collection<TransferListener> listeners)
listeners
- The listeners to delegate to, may be null
or empty.Method Detail |
---|
public void add(java.util.Collection<TransferListener> listeners)
listeners
- The listeners to add, may be null
or empty.public void add(TransferListener listener)
listener
- The listener to add, may be null
.public void remove(TransferListener listener)
listener
- The listener to remove, may be null
.protected void handleError(TransferEvent event, TransferListener listener, java.lang.RuntimeException error)
public void transferInitiated(TransferEvent event) throws TransferCancelledException
TransferListener
transferInitiated
in interface TransferListener
transferInitiated
in class AbstractTransferListener
event
- The event details, must not be null
.
TransferCancelledException
- If the transfer should be aborted.public void transferStarted(TransferEvent event) throws TransferCancelledException
TransferListener
transferStarted
in interface TransferListener
transferStarted
in class AbstractTransferListener
event
- The event details, must not be null
.
TransferCancelledException
- If the transfer should be aborted.public void transferProgressed(TransferEvent event) throws TransferCancelledException
TransferListener
transferProgressed
in interface TransferListener
transferProgressed
in class AbstractTransferListener
event
- The event details, must not be null
.
TransferCancelledException
- If the transfer should be aborted.public void transferCorrupted(TransferEvent event) throws TransferCancelledException
TransferListener
TransferEvent.getException()
will be of type
ChecksumFailureException
and can be used to query further details about the expected/actual checksums.
transferCorrupted
in interface TransferListener
transferCorrupted
in class AbstractTransferListener
event
- The event details, must not be null
.
TransferCancelledException
- If the transfer should be aborted.public void transferSucceeded(TransferEvent event)
TransferListener
transferSucceeded
in interface TransferListener
transferSucceeded
in class AbstractTransferListener
event
- The event details, must not be null
.public void transferFailed(TransferEvent event)
TransferListener
TransferEvent.getException()
will
provide further information about the failure.
transferFailed
in interface TransferListener
transferFailed
in class AbstractTransferListener
event
- The event details, must not be null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |