org.eclipse.aether.util.listener

## Class ChainedRepositoryListener

- java.lang.Object
- - org.eclipse.aether.AbstractRepositoryListener
  - - org.eclipse.aether.util.listener.ChainedRepositoryListener

- All Implemented Interfaces:
    RepositoryListener

      public final class ChainedRepositoryListener
      extends AbstractRepositoryListener

  A repository 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 and Description
    `ChainedRepositoryListener(Collection<? extends RepositoryListener> listeners)` Creates a new multicast listener that delegates to the specified listeners.
    `ChainedRepositoryListener(RepositoryListener... listeners)` Creates a new multicast listener that delegates to the specified listeners.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(Collection<? extends RepositoryListener> listeners)` Adds the specified listeners to the end of the multicast chain.
    `void` | `add(RepositoryListener listener)` Adds the specified listener to the end of the multicast chain.
    `void` | `artifactDeployed(RepositoryEvent event)` Notifies the listener of an artifact whose upload to a remote repository has been completed, either successfully or not.
    `void` | `artifactDeploying(RepositoryEvent event)` Notifies the listener of an artifact that is about to be uploaded to a remote repository.
    `void` | `artifactDescriptorInvalid(RepositoryEvent event)` Notifies the listener of a syntactically or semantically invalid artifact descriptor.
    `void` | `artifactDescriptorMissing(RepositoryEvent event)` Notifies the listener of a missing artifact descriptor.
    `void` | `artifactDownloaded(RepositoryEvent event)` Notifies the listener of an artifact whose download has been completed, either successfully or not.
    `void` | `artifactDownloading(RepositoryEvent event)` Notifies the listener of an artifact that is about to be downloaded from a remote repository.
    `void` | `artifactInstalled(RepositoryEvent event)` Notifies the listener of an artifact whose installation to the local repository has been completed, either successfully or not.
    `void` | `artifactInstalling(RepositoryEvent event)` Notifies the listener of an artifact that is about to be installed to the local repository.
    `void` | `artifactResolved(RepositoryEvent event)` Notifies the listener of an artifact whose resolution has been completed, either successfully or not.
    `void` | `artifactResolving(RepositoryEvent event)` Notifies the listener of an artifact that is about to be resolved.
    `protected void` | `handleError(RepositoryEvent event, RepositoryListener listener, RuntimeException error)`
    `void` | `metadataDeployed(RepositoryEvent event)` Notifies the listener of some metadata whose upload to a remote repository has been completed, either successfully or not.
    `void` | `metadataDeploying(RepositoryEvent event)` Notifies the listener of some metadata that is about to be uploaded to a remote repository.
    `void` | `metadataDownloaded(RepositoryEvent event)` Notifies the listener of some metadata whose download has been completed, either successfully or not.
    `void` | `metadataDownloading(RepositoryEvent event)` Notifies the listener of some metadata that is about to be downloaded from a remote repository.
    `void` | `metadataInstalled(RepositoryEvent event)` Notifies the listener of some metadata whose installation to the local repository has been completed, either successfully or not.
    `void` | `metadataInstalling(RepositoryEvent event)` Notifies the listener of some metadata that is about to be installed to the local repository.
    `void` | `metadataInvalid(RepositoryEvent event)` Notifies the listener of syntactically or semantically invalid metadata.
    `void` | `metadataResolved(RepositoryEvent event)` Notifies the listener of some metadata whose resolution has been completed, either successfully or not.
    `void` | `metadataResolving(RepositoryEvent event)` Notifies the listener of some metadata that is about to be resolved.
    `static RepositoryListener` | `newInstance(RepositoryListener listener1, RepositoryListener listener2)` Creates a new multicast listener that delegates to the specified listeners.
    `void` | `remove(RepositoryListener listener)` Removes the specified listener from the multicast chain.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ChainedRepositoryListener

          public ChainedRepositoryListener(RepositoryListener... listeners)

      Creates a new multicast listener that delegates to the specified listeners.
      Parameters:
        `listeners` - The listeners to delegate to, may be `null` or empty.

    - #### ChainedRepositoryListener

          public ChainedRepositoryListener(Collection<? extends RepositoryListener> 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 RepositoryListener newInstance(RepositoryListener listener1,
                                       RepositoryListener 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(Collection<? extends RepositoryListener> 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(RepositoryListener 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(RepositoryListener 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(RepositoryEvent event,
                         RepositoryListener listener,
                         RuntimeException error)

    - #### artifactDeployed

          public void artifactDeployed(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact whose upload to a remote repository has been completed, either successfully or not. `RepositoryEvent.getArtifact()` denotes the artifact in question and `RepositoryEvent.getExceptions()` indicates whether the upload succeeded or failed.
      Specified by:
        `artifactDeployed` in interface `RepositoryListener`
      Overrides:
        `artifactDeployed` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactDeploying

          public void artifactDeploying(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact that is about to be uploaded to a remote repository. `RepositoryEvent.getArtifact()` denotes the artifact in question and `RepositoryEvent.getRepository()` the destination repository.
      Specified by:
        `artifactDeploying` in interface `RepositoryListener`
      Overrides:
        `artifactDeploying` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactDescriptorInvalid

          public void artifactDescriptorInvalid(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of a syntactically or semantically invalid artifact descriptor. `RepositoryEvent.getArtifact()` indicates the artifact whose descriptor is invalid and `RepositoryEvent.getExceptions()` carries the encountered errors. Depending on the session's `ArtifactDescriptorPolicy`, the underlying repository operation might abort with an exception or ignore the invalid descriptor.
      Specified by:
        `artifactDescriptorInvalid` in interface `RepositoryListener`
      Overrides:
        `artifactDescriptorInvalid` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactDescriptorMissing

          public void artifactDescriptorMissing(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of a missing artifact descriptor. `RepositoryEvent.getArtifact()` indicates the artifact whose descriptor is missing. Depending on the session's `ArtifactDescriptorPolicy`, the underlying repository operation might abort with an exception or ignore the missing descriptor.
      Specified by:
        `artifactDescriptorMissing` in interface `RepositoryListener`
      Overrides:
        `artifactDescriptorMissing` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactDownloaded

          public void artifactDownloaded(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact whose download has been completed, either successfully or not. `RepositoryEvent.getArtifact()` denotes the artifact in question and `RepositoryEvent.getExceptions()` indicates whether the download succeeded or failed. Unlike the `RepositoryListener.artifactResolved(RepositoryEvent)` event, this event is only fired when the artifact does not already exist locally.
      Specified by:
        `artifactDownloaded` in interface `RepositoryListener`
      Overrides:
        `artifactDownloaded` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactDownloading

          public void artifactDownloading(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact that is about to be downloaded from a remote repository. `RepositoryEvent.getArtifact()` denotes the artifact in question and `RepositoryEvent.getRepository()` the source repository. Unlike the `RepositoryListener.artifactResolving(RepositoryEvent)` event, this event is only fired when the artifact does not already exist locally.
      Specified by:
        `artifactDownloading` in interface `RepositoryListener`
      Overrides:
        `artifactDownloading` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactInstalled

          public void artifactInstalled(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact whose installation to the local repository has been completed, either successfully or not. `RepositoryEvent.getArtifact()` denotes the artifact in question and `RepositoryEvent.getExceptions()` indicates whether the installation succeeded or failed.
      Specified by:
        `artifactInstalled` in interface `RepositoryListener`
      Overrides:
        `artifactInstalled` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactInstalling

          public void artifactInstalling(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact that is about to be installed to the local repository. `RepositoryEvent.getArtifact()` denotes the artifact in question.
      Specified by:
        `artifactInstalling` in interface `RepositoryListener`
      Overrides:
        `artifactInstalling` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactResolved

          public void artifactResolved(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact whose resolution has been completed, either successfully or not. `RepositoryEvent.getArtifact()` denotes the artifact in question and `RepositoryEvent.getExceptions()` indicates whether the resolution succeeded or failed. Unlike the `RepositoryListener.artifactDownloaded(RepositoryEvent)` event, this event is fired regardless whether the artifact already exists locally or not.
      Specified by:
        `artifactResolved` in interface `RepositoryListener`
      Overrides:
        `artifactResolved` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### artifactResolving

          public void artifactResolving(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of an artifact that is about to be resolved. `RepositoryEvent.getArtifact()` denotes the artifact in question. Unlike the `RepositoryListener.artifactDownloading(RepositoryEvent)` event, this event is fired regardless whether the artifact already exists locally or not.
      Specified by:
        `artifactResolving` in interface `RepositoryListener`
      Overrides:
        `artifactResolving` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataDeployed

          public void metadataDeployed(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata whose upload to a remote repository has been completed, either successfully or not. `RepositoryEvent.getMetadata()` denotes the metadata in question and `RepositoryEvent.getExceptions()` indicates whether the upload succeeded or failed.
      Specified by:
        `metadataDeployed` in interface `RepositoryListener`
      Overrides:
        `metadataDeployed` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataDeploying

          public void metadataDeploying(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata that is about to be uploaded to a remote repository. `RepositoryEvent.getMetadata()` denotes the metadata in question and `RepositoryEvent.getRepository()` the destination repository.
      Specified by:
        `metadataDeploying` in interface `RepositoryListener`
      Overrides:
        `metadataDeploying` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataDownloaded

          public void metadataDownloaded(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata whose download has been completed, either successfully or not. `RepositoryEvent.getMetadata()` denotes the metadata in question and `RepositoryEvent.getExceptions()` indicates whether the download succeeded or failed. Unlike the `RepositoryListener.metadataResolved(RepositoryEvent)` event, this event is only fired when the metadata does not already exist locally.
      Specified by:
        `metadataDownloaded` in interface `RepositoryListener`
      Overrides:
        `metadataDownloaded` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataDownloading

          public void metadataDownloading(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata that is about to be downloaded from a remote repository. `RepositoryEvent.getMetadata()` denotes the metadata in question and `RepositoryEvent.getRepository()` the source repository. Unlike the `RepositoryListener.metadataResolving(RepositoryEvent)` event, this event is only fired when the metadata does not already exist locally.
      Specified by:
        `metadataDownloading` in interface `RepositoryListener`
      Overrides:
        `metadataDownloading` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataInstalled

          public void metadataInstalled(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata whose installation to the local repository has been completed, either successfully or not. `RepositoryEvent.getMetadata()` denotes the metadata in question and `RepositoryEvent.getExceptions()` indicates whether the installation succeeded or failed.
      Specified by:
        `metadataInstalled` in interface `RepositoryListener`
      Overrides:
        `metadataInstalled` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataInstalling

          public void metadataInstalling(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata that is about to be installed to the local repository. `RepositoryEvent.getMetadata()` denotes the metadata in question.
      Specified by:
        `metadataInstalling` in interface `RepositoryListener`
      Overrides:
        `metadataInstalling` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataInvalid

          public void metadataInvalid(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of syntactically or semantically invalid metadata. `RepositoryEvent.getMetadata()` indicates the invalid metadata and `RepositoryEvent.getExceptions()` carries the encountered errors. The underlying repository operation might still succeed, depending on whether the metadata in question is actually needed to carry out the resolution process.
      Specified by:
        `metadataInvalid` in interface `RepositoryListener`
      Overrides:
        `metadataInvalid` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataResolved

          public void metadataResolved(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata whose resolution has been completed, either successfully or not. `RepositoryEvent.getMetadata()` denotes the metadata in question and `RepositoryEvent.getExceptions()` indicates whether the resolution succeeded or failed. Unlike the `RepositoryListener.metadataDownloaded(RepositoryEvent)` event, this event is fired regardless whether the metadata already exists locally or not.
      Specified by:
        `metadataResolved` in interface `RepositoryListener`
      Overrides:
        `metadataResolved` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

    - #### metadataResolving

          public void metadataResolving(RepositoryEvent event)

      Description copied from interface: `RepositoryListener`
      Notifies the listener of some metadata that is about to be resolved. `RepositoryEvent.getMetadata()` denotes the metadata in question. Unlike the `RepositoryListener.metadataDownloading(RepositoryEvent)` event, this event is fired regardless whether the metadata already exists locally or not.
      Specified by:
        `metadataResolving` in interface `RepositoryListener`
      Overrides:
        `metadataResolving` in class `AbstractRepositoryListener`
      Parameters:
        `event` - The event details, must not be `null`.

Copyright © 2010-2014 The Eclipse Foundation. All Rights Reserved.