Class 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

      Constructors 
      Constructor Description
      ChainedTransferListener​(java.util.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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.util.Collection<? extends org.eclipse.aether.transfer.TransferListener> listeners)
      Adds the specified listeners to the end of the multicast chain.
      void add​(org.eclipse.aether.transfer.TransferListener listener)
      Adds the specified listener to the end of the multicast chain.
      protected void handleError​(org.eclipse.aether.transfer.TransferEvent event, org.eclipse.aether.transfer.TransferListener listener, java.lang.RuntimeException error)  
      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.
      void remove​(org.eclipse.aether.transfer.TransferListener listener)
      Removes the specified listener from the multicast chain.
      void transferCorrupted​(org.eclipse.aether.transfer.TransferEvent event)  
      void transferFailed​(org.eclipse.aether.transfer.TransferEvent event)  
      void transferInitiated​(org.eclipse.aether.transfer.TransferEvent event)  
      void transferProgressed​(org.eclipse.aether.transfer.TransferEvent event)  
      void transferStarted​(org.eclipse.aether.transfer.TransferEvent event)  
      void transferSucceeded​(org.eclipse.aether.transfer.TransferEvent event)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChainedTransferListener

        public ChainedTransferListener​(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 be null or empty.
      • ChainedTransferListener

        public ChainedTransferListener​(java.util.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 be null or empty.
    • Method Detail

      • 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 actually null.
        Parameters:
        listener1 - The first listener, may be null.
        listener2 - The second listener, may be null.
        Returns:
        The chained listener or null if no listener was supplied.
      • add

        public void add​(java.util.Collection<? extends org.eclipse.aether.transfer.TransferListener> listeners)
        Adds the specified listeners to the end of the multicast chain.
        Parameters:
        listeners - The listeners to add, may be null or empty.
      • add

        public void add​(org.eclipse.aether.transfer.TransferListener listener)
        Adds the specified listener to the end of the multicast chain.
        Parameters:
        listener - The listener to add, may be null.
      • remove

        public void remove​(org.eclipse.aether.transfer.TransferListener listener)
        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 be null.
      • handleError

        protected void handleError​(org.eclipse.aether.transfer.TransferEvent event,
                                   org.eclipse.aether.transfer.TransferListener listener,
                                   java.lang.RuntimeException error)
      • transferInitiated

        public void transferInitiated​(org.eclipse.aether.transfer.TransferEvent event)
                               throws org.eclipse.aether.transfer.TransferCancelledException
        Specified by:
        transferInitiated in interface org.eclipse.aether.transfer.TransferListener
        Overrides:
        transferInitiated in class org.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:
        transferStarted in interface org.eclipse.aether.transfer.TransferListener
        Overrides:
        transferStarted in class org.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:
        transferProgressed in interface org.eclipse.aether.transfer.TransferListener
        Overrides:
        transferProgressed in class org.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:
        transferCorrupted in interface org.eclipse.aether.transfer.TransferListener
        Overrides:
        transferCorrupted in class org.eclipse.aether.transfer.AbstractTransferListener
        Throws:
        org.eclipse.aether.transfer.TransferCancelledException
      • transferSucceeded

        public void transferSucceeded​(org.eclipse.aether.transfer.TransferEvent event)
        Specified by:
        transferSucceeded in interface org.eclipse.aether.transfer.TransferListener
        Overrides:
        transferSucceeded in class org.eclipse.aether.transfer.AbstractTransferListener
      • transferFailed

        public void transferFailed​(org.eclipse.aether.transfer.TransferEvent event)
        Specified by:
        transferFailed in interface org.eclipse.aether.transfer.TransferListener
        Overrides:
        transferFailed in class org.eclipse.aether.transfer.AbstractTransferListener