Package org.eclipse.aether.util.listener
Class ChainedRepositoryListener
java.lang.Object
org.eclipse.aether.AbstractRepositoryListener
org.eclipse.aether.util.listener.ChainedRepositoryListener
- All Implemented Interfaces:
RepositoryListener
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
ConstructorDescriptionChainedRepositoryListener
(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
Modifier and TypeMethodDescriptionvoid
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
Notifies the listener of a syntactically or semantically invalid artifact descriptor.void
Notifies the listener of a missing artifact descriptor.void
Notifies the listener of an artifact whose download has been completed, either successfully or not.void
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
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) Invoked when any listener throws, by default is no op, extend if required.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
Notifies the listener of some metadata whose download has been completed, either successfully or not.void
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
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.
-
Constructor Details
-
ChainedRepositoryListener
Creates a new multicast listener that delegates to the specified listeners.- Parameters:
listeners
- The listeners to delegate to, may benull
or empty.
-
ChainedRepositoryListener
Creates a new multicast listener that delegates to the specified listeners.- Parameters:
listeners
- The listeners to delegate to, may benull
or empty.
-
-
Method Details
-
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 actuallynull
.- Parameters:
listener1
- The first listener, may benull
.listener2
- The second listener, may benull
.- Returns:
- The chained listener or
null
if no listener was supplied.
-
add
Adds the specified listeners to the end of the multicast chain.- Parameters:
listeners
- The listeners to add, may benull
or 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(RepositoryEvent event, RepositoryListener listener, RuntimeException error) Invoked when any listener throws, by default is no op, extend if required. -
artifactDeployed
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 andRepositoryEvent.getExceptions()
indicates whether the upload succeeded or failed.- Specified by:
artifactDeployed
in interfaceRepositoryListener
- Overrides:
artifactDeployed
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactDeploying
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 andRepositoryEvent.getRepository()
the destination repository.- Specified by:
artifactDeploying
in interfaceRepositoryListener
- Overrides:
artifactDeploying
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactDescriptorInvalid
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 andRepositoryEvent.getExceptions()
carries the encountered errors. Depending on the session'sArtifactDescriptorPolicy
, the underlying repository operation might abort with an exception or ignore the invalid descriptor.- Specified by:
artifactDescriptorInvalid
in interfaceRepositoryListener
- Overrides:
artifactDescriptorInvalid
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactDescriptorMissing
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'sArtifactDescriptorPolicy
, the underlying repository operation might abort with an exception or ignore the missing descriptor.- Specified by:
artifactDescriptorMissing
in interfaceRepositoryListener
- Overrides:
artifactDescriptorMissing
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactDownloaded
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 andRepositoryEvent.getExceptions()
indicates whether the download succeeded or failed. Unlike theRepositoryListener.artifactResolved(RepositoryEvent)
event, this event is only fired when the artifact does not already exist locally.- Specified by:
artifactDownloaded
in interfaceRepositoryListener
- Overrides:
artifactDownloaded
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactDownloading
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 andRepositoryEvent.getRepository()
the source repository. Unlike theRepositoryListener.artifactResolving(RepositoryEvent)
event, this event is only fired when the artifact does not already exist locally.- Specified by:
artifactDownloading
in interfaceRepositoryListener
- Overrides:
artifactDownloading
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactInstalled
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 andRepositoryEvent.getExceptions()
indicates whether the installation succeeded or failed.- Specified by:
artifactInstalled
in interfaceRepositoryListener
- Overrides:
artifactInstalled
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactInstalling
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 interfaceRepositoryListener
- Overrides:
artifactInstalling
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactResolved
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 andRepositoryEvent.getExceptions()
indicates whether the resolution succeeded or failed. Unlike theRepositoryListener.artifactDownloaded(RepositoryEvent)
event, this event is fired regardless whether the artifact already exists locally or not.- Specified by:
artifactResolved
in interfaceRepositoryListener
- Overrides:
artifactResolved
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
artifactResolving
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 theRepositoryListener.artifactDownloading(RepositoryEvent)
event, this event is fired regardless whether the artifact already exists locally or not.- Specified by:
artifactResolving
in interfaceRepositoryListener
- Overrides:
artifactResolving
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataDeployed
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 andRepositoryEvent.getExceptions()
indicates whether the upload succeeded or failed.- Specified by:
metadataDeployed
in interfaceRepositoryListener
- Overrides:
metadataDeployed
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataDeploying
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 andRepositoryEvent.getRepository()
the destination repository.- Specified by:
metadataDeploying
in interfaceRepositoryListener
- Overrides:
metadataDeploying
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataDownloaded
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 andRepositoryEvent.getExceptions()
indicates whether the download succeeded or failed. Unlike theRepositoryListener.metadataResolved(RepositoryEvent)
event, this event is only fired when the metadata does not already exist locally.- Specified by:
metadataDownloaded
in interfaceRepositoryListener
- Overrides:
metadataDownloaded
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataDownloading
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 andRepositoryEvent.getRepository()
the source repository. Unlike theRepositoryListener.metadataResolving(RepositoryEvent)
event, this event is only fired when the metadata does not already exist locally.- Specified by:
metadataDownloading
in interfaceRepositoryListener
- Overrides:
metadataDownloading
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataInstalled
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 andRepositoryEvent.getExceptions()
indicates whether the installation succeeded or failed.- Specified by:
metadataInstalled
in interfaceRepositoryListener
- Overrides:
metadataInstalled
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataInstalling
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 interfaceRepositoryListener
- Overrides:
metadataInstalling
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataInvalid
Description copied from interface:RepositoryListener
Notifies the listener of syntactically or semantically invalid metadata.RepositoryEvent.getMetadata()
indicates the invalid metadata andRepositoryEvent.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 interfaceRepositoryListener
- Overrides:
metadataInvalid
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataResolved
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 andRepositoryEvent.getExceptions()
indicates whether the resolution succeeded or failed. Unlike theRepositoryListener.metadataDownloaded(RepositoryEvent)
event, this event is fired regardless whether the metadata already exists locally or not.- Specified by:
metadataResolved
in interfaceRepositoryListener
- Overrides:
metadataResolved
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-
metadataResolving
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 theRepositoryListener.metadataDownloading(RepositoryEvent)
event, this event is fired regardless whether the metadata already exists locally or not.- Specified by:
metadataResolving
in interfaceRepositoryListener
- Overrides:
metadataResolving
in classAbstractRepositoryListener
- Parameters:
event
- The event details, must not benull
.
-