Skip to content

Commit

Permalink
[MRESOLVER-431] Make chained repository and transfer listeners extens…
Browse files Browse the repository at this point in the history
…ible (#361)

Add ability to extend classes.

---

https://issues.apache.org/jira/browse/MRESOLVER-431
  • Loading branch information
cstamas authored Nov 10, 2023
1 parent 43cae03 commit 4d39626
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* 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.
*/
public final class ChainedRepositoryListener extends AbstractRepositoryListener {
public class ChainedRepositoryListener extends AbstractRepositoryListener {

private final List<RepositoryListener> listeners = new CopyOnWriteArrayList<>();

Expand Down Expand Up @@ -110,6 +110,9 @@ public void remove(RepositoryListener listener) {
}
}

/**
* Invoked when any listener throws, by default is no op, extend if required.
*/
@SuppressWarnings("EmptyMethod")
protected void handleError(RepositoryEvent event, RepositoryListener listener, RuntimeException error) {
// default just swallows errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* 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.
*/
public final class ChainedTransferListener extends AbstractTransferListener {
public class ChainedTransferListener extends AbstractTransferListener {

private final List<TransferListener> listeners = new CopyOnWriteArrayList<>();

Expand Down Expand Up @@ -111,6 +111,9 @@ public void remove(TransferListener listener) {
}
}

/**
* Invoked when any listener throws, by default is no op, extend if required.
*/
@SuppressWarnings("EmptyMethod")
protected void handleError(TransferEvent event, TransferListener listener, RuntimeException error) {
// default just swallows errors
Expand Down

0 comments on commit 4d39626

Please sign in to comment.