Package org.eclipse.aether.util.listener
Class ChainedTransferListener
java.lang.Object
org.eclipse.aether.transfer.AbstractTransferListener
org.eclipse.aether.util.listener.ChainedTransferListener
- All Implemented Interfaces:
org.eclipse.aether.transfer.TransferListener
public final class ChainedTransferListener
extends org.eclipse.aether.transfer.AbstractTransferListener
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
ConstructorsConstructorDescriptionChainedTransferListener(Collection<? extends org.eclipse.aether.transfer.TransferListener> listeners) Creates a new multicast listener that delegates to the specified listeners.ChainedTransferListener(org.eclipse.aether.transfer.TransferListener... listeners) Creates a new multicast listener that delegates to the specified listeners. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Collection<? extends org.eclipse.aether.transfer.TransferListener> listeners) Adds the specified listeners to the end of the multicast chain.voidadd(org.eclipse.aether.transfer.TransferListener listener) Adds the specified listener to the end of the multicast chain.protected voidhandleError(org.eclipse.aether.transfer.TransferEvent event, org.eclipse.aether.transfer.TransferListener listener, RuntimeException error) static org.eclipse.aether.transfer.TransferListenernewInstance(org.eclipse.aether.transfer.TransferListener listener1, org.eclipse.aether.transfer.TransferListener listener2) Creates a new multicast listener that delegates to the specified listeners.voidremove(org.eclipse.aether.transfer.TransferListener listener) Removes the specified listener from the multicast chain.voidtransferCorrupted(org.eclipse.aether.transfer.TransferEvent event) voidtransferFailed(org.eclipse.aether.transfer.TransferEvent event) voidtransferInitiated(org.eclipse.aether.transfer.TransferEvent event) voidtransferProgressed(org.eclipse.aether.transfer.TransferEvent event) voidtransferStarted(org.eclipse.aether.transfer.TransferEvent event) voidtransferSucceeded(org.eclipse.aether.transfer.TransferEvent event)
-
Constructor Details
-
ChainedTransferListener
Creates a new multicast listener that delegates to the specified listeners.- Parameters:
listeners- The listeners to delegate to, may benullor empty.
-
ChainedTransferListener
public ChainedTransferListener(Collection<? extends org.eclipse.aether.transfer.TransferListener> listeners) Creates a new multicast listener that delegates to the specified listeners.- Parameters:
listeners- The listeners to delegate to, may benullor empty.
-
-
Method Details
-
newInstance
public static org.eclipse.aether.transfer.TransferListener newInstance(org.eclipse.aether.transfer.TransferListener listener1, org.eclipse.aether.transfer.TransferListener listener2) Creates a new multicast listener that delegates to the specified listeners. In contrast to the constructor, this factory method will avoid creating an actual chained listener if one of the specified readers is actuallynull.- Parameters:
listener1- The first listener, may benull.listener2- The second listener, may benull.- Returns:
- The chained listener or
nullif no listener was supplied.
-
add
Adds the specified listeners to the end of the multicast chain.- Parameters:
listeners- The listeners to add, may benullor empty.
-
add
Adds the specified listener to the end of the multicast chain.- Parameters:
listener- The listener to add, may benull.
-
remove
Removes the specified listener from the multicast chain. Trying to remove a non-existing listener has no effect.- Parameters:
listener- The listener to remove, may benull.
-
handleError
protected void handleError(org.eclipse.aether.transfer.TransferEvent event, org.eclipse.aether.transfer.TransferListener listener, RuntimeException error) -
transferInitiated
public void transferInitiated(org.eclipse.aether.transfer.TransferEvent event) throws org.eclipse.aether.transfer.TransferCancelledException - Specified by:
transferInitiatedin interfaceorg.eclipse.aether.transfer.TransferListener- Overrides:
transferInitiatedin classorg.eclipse.aether.transfer.AbstractTransferListener- Throws:
org.eclipse.aether.transfer.TransferCancelledException
-
transferStarted
public void transferStarted(org.eclipse.aether.transfer.TransferEvent event) throws org.eclipse.aether.transfer.TransferCancelledException - Specified by:
transferStartedin interfaceorg.eclipse.aether.transfer.TransferListener- Overrides:
transferStartedin classorg.eclipse.aether.transfer.AbstractTransferListener- Throws:
org.eclipse.aether.transfer.TransferCancelledException
-
transferProgressed
public void transferProgressed(org.eclipse.aether.transfer.TransferEvent event) throws org.eclipse.aether.transfer.TransferCancelledException - Specified by:
transferProgressedin interfaceorg.eclipse.aether.transfer.TransferListener- Overrides:
transferProgressedin classorg.eclipse.aether.transfer.AbstractTransferListener- Throws:
org.eclipse.aether.transfer.TransferCancelledException
-
transferCorrupted
public void transferCorrupted(org.eclipse.aether.transfer.TransferEvent event) throws org.eclipse.aether.transfer.TransferCancelledException - Specified by:
transferCorruptedin interfaceorg.eclipse.aether.transfer.TransferListener- Overrides:
transferCorruptedin classorg.eclipse.aether.transfer.AbstractTransferListener- Throws:
org.eclipse.aether.transfer.TransferCancelledException
-
transferSucceeded
- Specified by:
transferSucceededin interfaceorg.eclipse.aether.transfer.TransferListener- Overrides:
transferSucceededin classorg.eclipse.aether.transfer.AbstractTransferListener
-
transferFailed
- Specified by:
transferFailedin interfaceorg.eclipse.aether.transfer.TransferListener- Overrides:
transferFailedin classorg.eclipse.aether.transfer.AbstractTransferListener
-