@Override public void run() { // To register the backend controller in the event dispatch thread BackendControllerHolder.setSessionBackendController(backendController); initLoginProcess(); } });
/** * Programmatically stops the application and performs all necessary cleanups. */ public void stop() { // Breaks SSO. Useless to perform before garbage collecting. // if (frontendController != null) { // frontendController.stop(); // } frontendController = null; BackendControllerHolder.setSessionBackendController(null); } }
/** * Binds to the backend controller and ask it to start. * <p> * {@inheritDoc} */ @Override public boolean start(IBackendController peerController, Locale theClientLocale, TimeZone theClientTimeZone) { this.clientLocale = theClientLocale; Locale initialLocale = theClientLocale; if (forcedStartingLocale != null) { initialLocale = LocaleUtils.toLocale(forcedStartingLocale); } started = peerController.start(initialLocale, theClientTimeZone); peerController.addDirtInterceptor(dirtInterceptor); BackendControllerHolder.setSessionBackendController(peerController); return started; }
/** * Both front and back controllers are retrieved from the spring context, * associated and started. * <p> * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public void start() { // start on brand new instances. stop(); IBackendController backendController; try { backendController = (IBackendController) getApplicationContext().getBean( "applicationBackController"); } catch (RuntimeException ex) { LOG.error("applicationBackController could not be instantiated.", ex); throw ex; } try { frontendController = (IFrontendController<E, F, G>) getApplicationContext() .getBean("applicationFrontController"); } catch (RuntimeException ex) { LOG.error("applicationFrontController could not be instantiated.", ex); throw ex; } frontendController.start(backendController, getStartupLocale(), getClientTimeZone()); BackendControllerHolder.setSessionBackendController(backendController); }
IBackendController mockBackController = (IBackendController) appContext .getBean("applicationBackController"); BackendControllerHolder.setSessionBackendController(mockBackController);