Github user alasdairhodge commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/735#discussion_r34247759
--- Diff:
software/webapp/src/test/java/brooklyn/test/entity/TestJavaWebAppEntityImpl.java
---
@@ -91,4 +73,25 @@ public int getB() {
public int getC() {
return c;
}
+
+ @Override
+ protected SoftwareProcessDriverLifecycleEffectorTasks
getLifecycleEffectorTasks() {
+ return new SoftwareProcessDriverLifecycleEffectorTasks() {
+ public void start(java.util.Collection<? extends Location>
locations) {
+ ServiceStateLogic.setExpectedState(entity(),
Lifecycle.STARTING);
+ LOG.trace("Starting {}", this);
+ entity().setAttribute(SERVICE_PROCESS_IS_RUNNING, true);
+ entity().setAttribute(Attributes.SERVICE_UP, true);
+ ServiceStateLogic.setExpectedState(entity(),
Lifecycle.RUNNING);
+ }
+
+ public void stop() {
+ ServiceStateLogic.setExpectedState(entity(),
Lifecycle.STOPPING);
+ LOG.trace("Stopping {}", this);
+ entity().setAttribute(Attributes.SERVICE_UP, false);
+ entity().setAttribute(SERVICE_PROCESS_IS_RUNNING, false);
+ ServiceStateLogic.setExpectedState(entity(),
Lifecycle.STOPPED);
+ }
+ };
+ }
--- End diff --
This override ignores any confgured lifecycle-tasks, which could be
surprising-in-a-bad-way. I guess we'd really like to override the config key's
*default* (which isn't possible).
---
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.
---