diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/composite/AbstractCompositeEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/composite/AbstractCompositeEffector.java index 9fa31f523f1..057f6af32e7 100644 --- a/core/src/main/java/org/apache/brooklyn/core/effector/composite/AbstractCompositeEffector.java +++ b/core/src/main/java/org/apache/brooklyn/core/effector/composite/AbstractCompositeEffector.java @@ -158,8 +158,7 @@ protected String getInputParameter(Object effectorDetails) { } protected Object invokeEffectorNamed(Entity target, String effectorName, ConfigBag params) { - LOG.info("{} invoking effector on {}, effector={}, parameters={}", - new Object[]{this, target, effectorName, params}); + LOG.info("{} invoking {} with params {}", new Object[] { this, effectorName, params }); Maybe> effector = target.getEntityType().getEffectorByName(effectorName); if (effector.isAbsent()) { throw new IllegalStateException("Cannot find effector " + effectorName); diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/composite/ComposeEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/composite/ComposeEffector.java index 7884536216c..96548a326a6 100644 --- a/core/src/main/java/org/apache/brooklyn/core/effector/composite/ComposeEffector.java +++ b/core/src/main/java/org/apache/brooklyn/core/effector/composite/ComposeEffector.java @@ -73,6 +73,7 @@ public Body(Effector eff, ConfigBag config) { @Override public Object call(final ConfigBag params) { + LOG.info("{} called with config {}", new Object[] { this, config }); List effectors = EntityInitializers.resolve(config, COMPOSE); Object result = null; @@ -82,6 +83,7 @@ public Object call(final ConfigBag params) { String inputArgument = getInputArgument(effectorDetails); String inputParameter = getInputParameter(effectorDetails); Entity targetEntity = getTargetEntity(effectorDetails); + LOG.info("{} executing {}({}:{}) on {}", new Object[] { this, effectorName, inputArgument, inputParameter, targetEntity }); if (inputArgument == null) { throw new IllegalArgumentException("Input is not set for this effector: " + effectorDetails); diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/composite/LoopEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/composite/LoopEffector.java index 9e694f6ee3c..87675798012 100644 --- a/core/src/main/java/org/apache/brooklyn/core/effector/composite/LoopEffector.java +++ b/core/src/main/java/org/apache/brooklyn/core/effector/composite/LoopEffector.java @@ -76,6 +76,7 @@ public Body(Effector eff, ConfigBag config) { @Override public List call(final ConfigBag params) { + LOG.info("{} called with config {}", new Object[] { this, config }); Object effectorDetails = EntityInitializers.resolve(config, LOOP); String input = config.get(INPUT); Object inputObject = config.getStringKey(input); @@ -89,6 +90,7 @@ public List call(final ConfigBag params) { String effectorName = getEffectorName(effectorDetails); String inputArgument = getInputArgument(effectorDetails); Entity targetEntity = getTargetEntity(effectorDetails); + LOG.info("{} executing {}({}) on {}", new Object[] { this, effectorName, inputArgument, targetEntity }); if (inputArgument == null) { throw new IllegalArgumentException("Input is not set for this effector: " + effectorDetails); diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/composite/ReplaceEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/composite/ReplaceEffector.java index c580cc17e99..bd1adb2ca43 100644 --- a/core/src/main/java/org/apache/brooklyn/core/effector/composite/ReplaceEffector.java +++ b/core/src/main/java/org/apache/brooklyn/core/effector/composite/ReplaceEffector.java @@ -104,12 +104,14 @@ public Body(Effector eff, ConfigBag config) { @Override public Object call(final ConfigBag params) { + LOG.info("{} called with config {}", new Object[] { this, config }); ReplaceAction action = config.get(ACTION); Object effectorDetails = EntityInitializers.resolve(config, REPLACE); String effectorName = getEffectorName(effectorDetails); String inputArgument = getInputArgument(effectorDetails); Entity targetEntity = getTargetEntity(effectorDetails); + LOG.info("{} executing {}({}) on {}", new Object[] { this, effectorName, inputArgument, targetEntity }); if (inputArgument != null) { Object input = config.getStringKey(inputArgument); diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/composite/SequenceEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/composite/SequenceEffector.java index 8f40365e21e..2bde97a7c1b 100644 --- a/core/src/main/java/org/apache/brooklyn/core/effector/composite/SequenceEffector.java +++ b/core/src/main/java/org/apache/brooklyn/core/effector/composite/SequenceEffector.java @@ -74,6 +74,7 @@ public Body(Effector eff, ConfigBag config) { @Override public Object call(final ConfigBag params) { + LOG.info("{} called with config {}", new Object[] { this, config }); List effectors = EntityInitializers.resolve(config, SEQUENCE); Object result = null; @@ -82,6 +83,7 @@ public Object call(final ConfigBag params) { String effectorName = getEffectorName(effectorDetails); String inputArgument = getInputArgument(effectorDetails); Entity targetEntity = getTargetEntity(effectorDetails); + LOG.info("{} executing {}({}) on {}", new Object[] { this, effectorName, inputArgument, targetEntity }); if (inputArgument == null) { throw new IllegalArgumentException("Input is not set for this effector: " + effectorDetails); diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/composite/TransformEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/composite/TransformEffector.java index e68e44bf835..2dbadc0392d 100644 --- a/core/src/main/java/org/apache/brooklyn/core/effector/composite/TransformEffector.java +++ b/core/src/main/java/org/apache/brooklyn/core/effector/composite/TransformEffector.java @@ -76,6 +76,7 @@ public Body(Effector eff, ConfigBag config) { @Override public Object call(final ConfigBag params) { + LOG.info("{} called with config {}", new Object[] { this, config }); Function function = EntityInitializers.resolve(config, FUNCTION); String input = config.get(INPUT); diff --git a/policy/src/main/java/org/apache/brooklyn/policy/action/PeriodicEffectorPolicy.java b/policy/src/main/java/org/apache/brooklyn/policy/action/PeriodicEffectorPolicy.java index 44ec00fb5f8..53a378ff9b5 100644 --- a/policy/src/main/java/org/apache/brooklyn/policy/action/PeriodicEffectorPolicy.java +++ b/policy/src/main/java/org/apache/brooklyn/policy/action/PeriodicEffectorPolicy.java @@ -36,6 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.api.client.repackaged.com.google.common.base.Preconditions; import com.google.common.annotations.Beta; import com.google.common.base.Predicates; @@ -75,7 +76,7 @@ public PeriodicEffectorPolicy() { public PeriodicEffectorPolicy(Map props) { super(props); - Duration period = config().get(PERIOD); + Duration period = Preconditions.checkNotNull(config().get(PERIOD), "The period must be copnfigured for this policy"); delay = period.toMilliseconds(); } diff --git a/policy/src/main/java/org/apache/brooklyn/policy/action/ScheduledEffectorPolicy.java b/policy/src/main/java/org/apache/brooklyn/policy/action/ScheduledEffectorPolicy.java index 00334507c02..ff2dbb7e19a 100644 --- a/policy/src/main/java/org/apache/brooklyn/policy/action/ScheduledEffectorPolicy.java +++ b/policy/src/main/java/org/apache/brooklyn/policy/action/ScheduledEffectorPolicy.java @@ -35,6 +35,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.api.client.repackaged.com.google.common.base.Preconditions; import com.google.common.annotations.Beta; import com.google.common.base.Predicates; @@ -70,7 +71,7 @@ public ScheduledEffectorPolicy() { public ScheduledEffectorPolicy(Map props) { super(props); - String time = config().get(TIME); + String time = Preconditions.checkNotNull(config().get(TIME), "The time must be configured for this policy"); DateFormat format = DateFormat.getDateTimeInstance(); try { when = format.parse(time);