Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/131#discussion_r16923689
--- Diff: core/src/main/java/brooklyn/entity/basic/AbstractApplication.java
---
@@ -174,18 +194,20 @@ public void postStart(Collection<? extends Location>
locations) {
public void stop() {
logApplicationLifecycle("Stopping");
+ ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this,
Attributes.SERVICE_STATE_ACTUAL, "Application stopping");
setAttribute(SERVICE_UP, false);
- setAttribute(Attributes.SERVICE_STATE, Lifecycle.STOPPING);
+ ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPING);
recordApplicationEvent(Lifecycle.STOPPING);
try {
doStop();
} catch (Exception e) {
- setAttribute(Attributes.SERVICE_STATE, Lifecycle.ON_FIRE);
+ ServiceStateLogic.setExpectedState(this, Lifecycle.ON_FIRE);
--- End diff --
setting expected state is also valid. it just means it will get cleared on
a stop or start/restart.
still not sure what best way is, in other places you may have seen, i used
the `START` effector as a problem indicator, and cleared it when
starting/stopping. neither felt perfect, tho neither felt that bad. thoughts?
(happy to leave for subsequent PR.)
---
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.
---