allow to stop context

6.19.x
Yevhenii Voevodin 2017-04-12 16:54:42 +03:00
parent 791b898447
commit 38cc160c79
3 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,8 @@ import static com.google.inject.multibindings.Multibinder.newSetBinder;
*
* @author Kaloyan Raev
*/
@DynaModule
// FIXME: spi
//@DynaModule
public class ComposerModule extends AbstractModule {
/** {@inheritDoc} */

View File

@ -24,6 +24,7 @@ public class MachineModule extends AbstractModule {
protected void configure() {
bind(KeysInjector.class).asEagerSingleton();
bind(WorkspaceSshKeys.class).asEagerSingleton();
bind(RecipeScriptDownloadService.class);
// FIXME: spi
// bind(RecipeScriptDownloadService.class);
}
}

View File

@ -71,15 +71,14 @@ public abstract class RuntimeContext {
*
* @param stopOptions
* @throws StateException
* when the context is already used or the context
* can't be stopped because otherwise it would be in inconsistent state
* when the context can't be stopped because otherwise it would be in inconsistent state
* (e.g. stop(interrupt) might not be allowed during start)
* @throws InfrastructureException
* when any other error occurs
*/
public final void stop(Map<String, String> stopOptions) throws InfrastructureException {
if (this.state != null)
throw new StateException("Context already used");
if (this.state != WorkspaceStatus.RUNNING)
throw new StateException("The environment must be running");
state = WorkspaceStatus.STOPPING;
internalStop(stopOptions);
state = WorkspaceStatus.STOPPED;