/** * 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); }
/** * Registers the controller in the http session. * <p> * {@inheritDoc} */ @Override public void start() { if (System.getProperty("java.security.auth.login.config") == null && HttpRequestHolder.isAvailable()) { System.setProperty("java.security.auth.login.config", ResourceProviderServlet.computeStaticUrl("conf/jaas.config")); } super.start(); if (HttpRequestHolder.isAvailable()) { HttpSession session = HttpRequestHolder.getServletRequest().getSession(); if (session != null) { session.setAttribute(RemotePeerRegistryServlet.PEER_REGISTRY, getFrontendController()); session.setAttribute(RemoteUtilServlet.REMOTE_STARTUP, this); } } }