public synchronized void registerActivity(final ServerActivity activity) { this.activities.add(activity); if(state != State.RUNNING) { //if the activity is added when we are not running we just immediately suspend it //this should only happen at boot, so there should be no outstanding requests anyway activity.suspended(() -> { }); } }
public synchronized void registerActivity(final ServerActivity activity) { this.activities.add(activity); if(state != State.RUNNING) { //if the activity is added when we are not running we just immediately suspend it //this should only happen at boot, so there should be no outstanding requests anyway activity.suspended(() -> { }); } }
state = State.SUSPENDING; for (ServerActivity activity : activities) { activity.suspended(SuspendController.this.listener);
state = State.SUSPENDING; for (ServerActivity activity : activities) { activity.suspended(SuspendController.this.listener);