Permalink
Browse files

[MSC-128] NEW state belongs to REST states set

  • Loading branch information...
1 parent a711087 commit cbb6f7f94db06758851dd0f23a465b0b7753553d @ropalka ropalka committed Feb 11, 2013
View
2 src/main/java/org/jboss/msc/service/ServiceController.java
@@ -292,7 +292,7 @@ public boolean in(Mode... modes) {
/**
* New controller being installed.
*/
- NEW(State.DOWN, false),
+ NEW(State.DOWN, true),
/**
* Cancelled controller installation due to duplicate or other problem.
*/
View
19 src/main/java/org/jboss/msc/service/ServiceControllerImpl.java
@@ -253,11 +253,12 @@ void commitInstallation(Mode initialMode) {
final ArrayList<Runnable> tasks = new ArrayList<Runnable>(16);
synchronized (this) {
+ final boolean leavingRestState = isStableRestState();
getListenerTasks(ListenerNotification.LISTENER_ADDED, listenerAddedTasks);
internalSetMode(initialMode, tasks);
// placeholder async task for running listener added tasks
asyncTasks += listenerAddedTasks.size() + tasks.size() + 1;
- updateStabilityState(true);
+ updateStabilityState(leavingRestState);
}
doExecute(tasks);
tasks.clear();
@@ -299,16 +300,14 @@ void commitInstallation(Mode initialMode) {
* Roll back the service install.
*/
void rollbackInstallation() {
- final boolean stabilityNotification;
synchronized(this) {
- stabilityNotification = state != Substate.NEW;
final boolean leavingRestState = isStableRestState();
mode = Mode.REMOVE;
asyncTasks ++;
state = Substate.CANCELLED;
- if (stabilityNotification) updateStabilityState(leavingRestState);
+ updateStabilityState(leavingRestState);
}
- (new RemoveTask(stabilityNotification)).run();
+ (new RemoveTask()).run();
}
/**
@@ -678,7 +677,7 @@ void transition(final ArrayList<Runnable> tasks) {
if (failCount > 0) {
tasks.add(new DependencyRetryingTask(dependents));
}
- tasks.add(new RemoveTask(true));
+ tasks.add(new RemoveTask());
break;
}
case REMOVING_to_REMOVED: {
@@ -2270,12 +2269,6 @@ public void run() {
}
private class RemoveTask implements Runnable {
-
- private final boolean stabilityNotification;
-
- RemoveTask(final boolean stabilityNotification) {
- this.stabilityNotification = stabilityNotification;
- }
public void run() {
try {
@@ -2297,7 +2290,7 @@ public void run() {
asyncTasks --;
transition(tasks);
asyncTasks += tasks.size();
- if (stabilityNotification) updateStabilityState(leavingRestState);
+ updateStabilityState(leavingRestState);
}
doExecute(tasks);
} catch (Throwable t) {

0 comments on commit cbb6f7f

Please sign in to comment.