allow to stop context
parent
791b898447
commit
38cc160c79
|
|
@ -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} */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue