class ContainerPresenter {

    public void removeContainer() {
        view.confirmRemove(new Command() {
            @Override
            public void execute() {
                specManagementService.call(new RemoteCallback<Void>() {
                                               @Override
                                               public void callback(final Void response) {
                                                   notification.fire(new NotificationEvent(view.getRemoveContainerSuccessMessage(),
                                                                                           NotificationEvent.NotificationType.SUCCESS));
                                                   serverTemplateSelectedEvent.fire(new ServerTemplateSelected(containerSpec.getServerTemplateKey()));
                                               }
                                           },
                                           new ErrorCallback<Object>() {
                                               @Override
                                               public boolean error(final Object o,
                                                                    final Throwable throwable) {
                                                   notification.fire(new NotificationEvent(view.getRemoveContainerErrorMessage(),
                                                                                           NotificationEvent.NotificationType.ERROR));
                                                   serverTemplateSelectedEvent.fire(new ServerTemplateSelected(containerSpec.getServerTemplateKey()));
                                                   return false;
                                               }
                                           }).deleteContainerSpec(containerSpec.getServerTemplateKey().getId(),
                                                                  containerSpec.getId());
            }
        });
    }

    @Inject public  ContainerPresenter(final Logger logger,
                              final View view,
                              final ContainerRemoteStatusPresenter containerRemoteStatusPresenter,
                              final ContainerStatusEmptyPresenter containerStatusEmptyPresenter,
                              final ContainerProcessConfigPresenter containerProcessConfigPresenter,
                              final ContainerRulesConfigPresenter containerRulesConfigPresenter,
                              final Caller<RuntimeManagementService> runtimeManagementService,
                              final Caller<SpecManagementService> specManagementService,
                              final Event<ServerTemplateSelected> serverTemplateSelectedEvent,
                              final Event<NotificationEvent> notification);

}