Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/538#discussion_r25695467
--- Diff:
core/src/main/java/brooklyn/location/access/PortForwardManagerImpl.java ---
@@ -181,6 +187,15 @@ protected void associateImpl(String publicIpId,
HostAndPort publicEndpoint, Loca
onChanged();
}
+ private void emitAssociationCreatedEvent(String publicIpId,
HostAndPort publicEndpoint, Location location, int privatePort) {
+ AssociationMetadata metadata = new AssociationMetadata(publicIpId,
publicEndpoint, location, privatePort);
+ for (Map.Entry<AssociationListener, Predicate<? super
AssociationMetadata>> entry : associationListeners.entrySet()) {
+ if (entry.getValue().apply(metadata)) {
+ entry.getKey().onAssociationCreated(metadata);
--- End diff --
Should wrap this in try-catch block, to log.warn any exception. An
exception in one listener shouldn't cause the other listeners to not be called.
However, in the catch block first do `Exceptions.propagateIfFatal(e)`.
Same goes for the call to `onAssociationDeleted(metadata)`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---