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
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 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
-
-
-
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 benull
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 benull
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 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
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 benull
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 benull
.
-
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 benull
.
-
handleError
protected void handleError(RepositoryEvent event, RepositoryListener listener, RuntimeException error)
-
artifactDeployed
public void artifactDeployed(RepositoryEvent event)
- Specified by:
artifactDeployed
in interfaceRepositoryListener
- Overrides:
artifactDeployed
in classAbstractRepositoryListener
-
artifactDeploying
public void artifactDeploying(RepositoryEvent event)
- Specified by:
artifactDeploying
in interfaceRepositoryListener
- Overrides:
artifactDeploying
in classAbstractRepositoryListener
-
artifactDescriptorInvalid
public void artifactDescriptorInvalid(RepositoryEvent event)
- Specified by:
artifactDescriptorInvalid
in interfaceRepositoryListener
- Overrides:
artifactDescriptorInvalid
in classAbstractRepositoryListener
-
artifactDescriptorMissing
public void artifactDescriptorMissing(RepositoryEvent event)
- Specified by:
artifactDescriptorMissing
in interfaceRepositoryListener
- Overrides:
artifactDescriptorMissing
in classAbstractRepositoryListener
-
artifactDownloaded
public void artifactDownloaded(RepositoryEvent event)
- Specified by:
artifactDownloaded
in interfaceRepositoryListener
- Overrides:
artifactDownloaded
in classAbstractRepositoryListener
-
artifactDownloading
public void artifactDownloading(RepositoryEvent event)
- Specified by:
artifactDownloading
in interfaceRepositoryListener
- Overrides:
artifactDownloading
in classAbstractRepositoryListener
-
artifactInstalled
public void artifactInstalled(RepositoryEvent event)
- Specified by:
artifactInstalled
in interfaceRepositoryListener
- Overrides:
artifactInstalled
in classAbstractRepositoryListener
-
artifactInstalling
public void artifactInstalling(RepositoryEvent event)
- Specified by:
artifactInstalling
in interfaceRepositoryListener
- Overrides:
artifactInstalling
in classAbstractRepositoryListener
-
artifactResolved
public void artifactResolved(RepositoryEvent event)
- Specified by:
artifactResolved
in interfaceRepositoryListener
- Overrides:
artifactResolved
in classAbstractRepositoryListener
-
artifactResolving
public void artifactResolving(RepositoryEvent event)
- Specified by:
artifactResolving
in interfaceRepositoryListener
- Overrides:
artifactResolving
in classAbstractRepositoryListener
-
metadataDeployed
public void metadataDeployed(RepositoryEvent event)
- Specified by:
metadataDeployed
in interfaceRepositoryListener
- Overrides:
metadataDeployed
in classAbstractRepositoryListener
-
metadataDeploying
public void metadataDeploying(RepositoryEvent event)
- Specified by:
metadataDeploying
in interfaceRepositoryListener
- Overrides:
metadataDeploying
in classAbstractRepositoryListener
-
metadataDownloaded
public void metadataDownloaded(RepositoryEvent event)
- Specified by:
metadataDownloaded
in interfaceRepositoryListener
- Overrides:
metadataDownloaded
in classAbstractRepositoryListener
-
metadataDownloading
public void metadataDownloading(RepositoryEvent event)
- Specified by:
metadataDownloading
in interfaceRepositoryListener
- Overrides:
metadataDownloading
in classAbstractRepositoryListener
-
metadataInstalled
public void metadataInstalled(RepositoryEvent event)
- Specified by:
metadataInstalled
in interfaceRepositoryListener
- Overrides:
metadataInstalled
in classAbstractRepositoryListener
-
metadataInstalling
public void metadataInstalling(RepositoryEvent event)
- Specified by:
metadataInstalling
in interfaceRepositoryListener
- Overrides:
metadataInstalling
in classAbstractRepositoryListener
-
metadataInvalid
public void metadataInvalid(RepositoryEvent event)
- Specified by:
metadataInvalid
in interfaceRepositoryListener
- Overrides:
metadataInvalid
in classAbstractRepositoryListener
-
metadataResolved
public void metadataResolved(RepositoryEvent event)
- Specified by:
metadataResolved
in interfaceRepositoryListener
- Overrides:
metadataResolved
in classAbstractRepositoryListener
-
metadataResolving
public void metadataResolving(RepositoryEvent event)
- Specified by:
metadataResolving
in interfaceRepositoryListener
- Overrides:
metadataResolving
in classAbstractRepositoryListener
-
-