Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/112#discussion_r59354933
--- Diff:
core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java ---
@@ -259,17 +268,39 @@ protected void initEnrichers() {
// override previous enricher so that only members are checked
ServiceStateLogic.newEnricherFromChildrenUp().checkMembersOnly().requireUpChildren(getConfig(UP_QUORUM_CHECK)).addTo(this);
}
-
+
+ @Override
+ public void setConfigurableRemovalStrategy(RemovalStrategy val) {
+ config().set(CONFIGURABLE_REMOVAL_STRATEGY, checkNotNull(val,
"configurableRemovalStrategy"));
+ }
+
+ @Deprecated /** @deprecated since 0.9.0; use {@link
#setConfigurableRemovalStrategy instead} */
@Override
public void setRemovalStrategy(Function<Collection<Entity>, Entity>
val) {
config().set(REMOVAL_STRATEGY, checkNotNull(val,
"removalStrategy"));
}
+ @Deprecated /** @deprecated since 0.9.0; use {@link
#getConfigurableRemovalStrategy instead} */
protected Function<Collection<Entity>, Entity> getRemovalStrategy() {
Function<Collection<Entity>, Entity> result =
getConfig(REMOVAL_STRATEGY);
return (result != null) ? result : defaultRemovalStrategy;
}
+ protected RemovalStrategy getConfigurableRemovalStrategy() {
+ RemovalStrategy result = getConfig(CONFIGURABLE_REMOVAL_STRATEGY);
+ // Fallback to the deprecated REMOVAL_STRATEGY for
backwards-compatibility
+ if (result == null) {
+ result = new RemovalStrategy() {
--- End diff --
Make this a named inner class. New anonymous classes risk pain with
persistence later.
---
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.
---