class WorkbenchBackendEntryPoint {

    @PostConstruct
    public void init() {
        bus.addLifecycleListener(new BusLifecycleAdapter() {

            @Override
            public void busOnline(final BusLifecycleEvent e) {
                logger.info("Bus is back online.");
                setShowedError(false);
                resetRetries();
            }

            @Override
            public void busOffline(final BusLifecycleEvent e) {
                if (isShowedError()) {
                    return;
                }
                logger.error("Bus is offline. [" + e.getReason().getErrorMessage() + "]");
                if (!isWorkbenchOnCluster && !hasMoreRetries() && !isOpen()) {

                    errorPopupPresenter.showMessage("You've been disconnected.",
                                                    () -> isOpen = true,
                                                    () -> isOpen = false);
                    setShowedError(true);
                }
                decrementRetries();
            }
        });
        workbenchServices.isWorkbenchOnCluster(parameter -> isWorkbenchOnCluster = !(parameter == null || parameter.equals(Boolean.FALSE)));
    }

    public  WorkbenchBackendEntryPoint();
    @Inject public  WorkbenchBackendEntryPoint(final Logger logger,
                                      final ClientMessageBus bus,
                                      final WorkbenchServicesProxy workbenchServices,
                                      final ErrorPopupPresenter errorPopupPresenter);

}