Follow API changes in brooklyn-server
diff --git a/software/cm/ansible/src/main/java/org/apache/brooklyn/entity/cm/ansible/AnsibleLifecycleEffectorTasks.java b/software/cm/ansible/src/main/java/org/apache/brooklyn/entity/cm/ansible/AnsibleLifecycleEffectorTasks.java
index fd73c61..da4b2d7 100644
--- a/software/cm/ansible/src/main/java/org/apache/brooklyn/entity/cm/ansible/AnsibleLifecycleEffectorTasks.java
+++ b/software/cm/ansible/src/main/java/org/apache/brooklyn/entity/cm/ansible/AnsibleLifecycleEffectorTasks.java
@@ -27,6 +27,7 @@
import org.apache.brooklyn.core.entity.trait.Startable;
import org.apache.brooklyn.core.location.Locations;
import org.apache.brooklyn.core.location.Machines;
+import org.apache.brooklyn.core.sensor.ReleaseableLatch;
import org.apache.brooklyn.entity.software.base.SoftwareProcess;
import org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks;
import org.apache.brooklyn.feed.ssh.SshFeed;
@@ -37,6 +38,9 @@
import org.apache.brooklyn.util.net.Urls;
import static org.apache.brooklyn.util.ssh.BashCommands.sudo;
+
+import java.util.concurrent.atomic.AtomicReference;
+
import org.apache.brooklyn.util.text.Strings;
import org.apache.brooklyn.util.time.Duration;
import org.apache.brooklyn.util.time.Time;
@@ -135,7 +139,8 @@
}
- protected void postStartCustom() {
+ @Override
+ protected void postStartCustom(AtomicReference<ReleaseableLatch> startLatchRef) {
boolean result = false;
result |= tryCheckStartService();
@@ -173,11 +178,12 @@
.setOnFailureOrException(false))
.build();
- entity().feeds().addFeed(serviceSshFeed);
+ entity().feeds().add(serviceSshFeed);
} else {
LOG.warn("Location(s) {} not an ssh-machine location, so not polling for status; "
+ "setting serviceUp immediately", entity().getLocations());
}
+ super.postStartCustom(startLatchRef);
}
protected boolean tryCheckStartService() {
diff --git a/software/cm/salt/src/main/java/org/apache/brooklyn/entity/cm/salt/impl/SaltLifecycleEffectorTasks.java b/software/cm/salt/src/main/java/org/apache/brooklyn/entity/cm/salt/impl/SaltLifecycleEffectorTasks.java
index 871caea..cc02546 100644
--- a/software/cm/salt/src/main/java/org/apache/brooklyn/entity/cm/salt/impl/SaltLifecycleEffectorTasks.java
+++ b/software/cm/salt/src/main/java/org/apache/brooklyn/entity/cm/salt/impl/SaltLifecycleEffectorTasks.java
@@ -18,21 +18,28 @@
*/
package org.apache.brooklyn.entity.cm.salt.impl;
-import com.google.common.annotations.Beta;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableMap;
+import static java.util.regex.Pattern.DOTALL;
+import static java.util.regex.Pattern.MULTILINE;
+import static org.apache.brooklyn.entity.software.base.SoftwareProcess.StopSoftwareParameters.StopMode.ALWAYS;
+import static org.apache.brooklyn.entity.software.base.SoftwareProcess.StopSoftwareParameters.StopMode.NEVER;
+
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import org.apache.brooklyn.api.effector.Effector;
import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.location.MachineLocation;
import org.apache.brooklyn.api.mgmt.TaskAdaptable;
import org.apache.brooklyn.camp.brooklyn.BrooklynCampConstants;
-import org.apache.brooklyn.entity.cm.salt.SaltConfig;
import org.apache.brooklyn.core.effector.Effectors;
import org.apache.brooklyn.core.entity.Entities;
import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
import org.apache.brooklyn.core.entity.trait.Startable;
+import org.apache.brooklyn.core.sensor.ReleaseableLatch;
+import org.apache.brooklyn.entity.cm.salt.SaltConfig;
import org.apache.brooklyn.entity.software.base.SoftwareProcess;
import org.apache.brooklyn.entity.software.base.SoftwareProcess.StopSoftwareParameters;
import org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks;
@@ -46,14 +53,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static java.util.regex.Pattern.DOTALL;
-import static java.util.regex.Pattern.MULTILINE;
-import static org.apache.brooklyn.entity.software.base.SoftwareProcess.StopSoftwareParameters.StopMode.ALWAYS;
-import static org.apache.brooklyn.entity.software.base.SoftwareProcess.StopSoftwareParameters.StopMode.NEVER;
+import com.google.common.annotations.Beta;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableMap;
@Beta
public class SaltLifecycleEffectorTasks extends MachineLifecycleEffectorTasks implements SaltConfig {
@@ -165,10 +168,11 @@
SaltHighstate.applyHighstate(stateDescription, entity());
}
-
- protected void postStartCustom() {
+ @Override
+ protected void postStartCustom(AtomicReference<ReleaseableLatch> startLatchRef) {
// TODO: check for package installed?
entity().sensors().set(SoftwareProcess.SERVICE_UP, true);
+ super.postStartCustom(startLatchRef);
}
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeChefImplFromScratch.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeChefImplFromScratch.java
index 96e65a5..0414fbe 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeChefImplFromScratch.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeChefImplFromScratch.java
@@ -18,6 +18,8 @@
*/
package org.apache.brooklyn.entity.database.postgresql;
+import java.util.concurrent.atomic.AtomicReference;
+
import org.apache.brooklyn.api.effector.Effector;
import org.apache.brooklyn.config.ConfigKey;
import org.apache.brooklyn.core.config.ConfigKeys;
@@ -26,6 +28,7 @@
import org.apache.brooklyn.core.effector.ssh.SshEffectorTasks;
import org.apache.brooklyn.core.entity.Entities;
import org.apache.brooklyn.core.location.Locations;
+import org.apache.brooklyn.core.sensor.ReleaseableLatch;
import org.apache.brooklyn.entity.chef.ChefConfig;
import org.apache.brooklyn.entity.chef.ChefLifecycleEffectorTasks;
import org.apache.brooklyn.entity.chef.ChefServerTasks;
@@ -77,6 +80,7 @@
usePidFile("/var/run/postgresql/*.pid");
useService("postgresql");
}
+ @Override
protected void startWithKnifeAsync() {
Entities.warnOnIgnoringConfig(entity(), ChefConfig.CHEF_LAUNCH_RUN_LIST);
Entities.warnOnIgnoringConfig(entity(), ChefConfig.CHEF_LAUNCH_ATTRIBUTES);
@@ -95,8 +99,9 @@
// no other arguments currenty supported; chef will pick a password for us
);
}
- protected void postStartCustom() {
- super.postStartCustom();
+ @Override
+ protected void postStartCustom(AtomicReference<ReleaseableLatch> startLatchRef) {
+ super.postStartCustom(startLatchRef);
// now run the creation script
String creationScript;
@@ -111,10 +116,12 @@
// and finally connect sensors
entity().connectSensors();
}
+ @Override
protected void preStopCustom() {
entity().disconnectSensors();
super.preStopCustom();
}
+ @Override
protected PostgreSqlNodeChefImplFromScratch entity() {
return (PostgreSqlNodeChefImplFromScratch) super.entity();
}