/** * Executes a backend action. * * @param action * the backend action to execute. * @param initialContext * the initial action context. * @param subject * the JAAS subject to execute the action for. * @param locale * the locale used to execute the action. * @return true if the action execution was successful. */ protected boolean executeAction(BackendAction action, Map<String, Object> initialContext, Subject subject, Locale locale) { configureApplicationSession(subject, locale); Map<String, Object> startupActionContext = new HashMap<>(); startupActionContext.putAll(getBackendController() .getInitialActionContext()); startupActionContext.putAll(initialContext); boolean success = getBackendController().execute(action, startupActionContext); return success; }
/** * Configures session on the backend controller. * * @param subject * the JAAS subject containing the user principal. * @param locale * the locale to use. */ protected void configureApplicationSession(Subject subject, Locale locale) { IApplicationSession session = getBackendController() .getApplicationSession(); session.setSubject(subject); session.setLocale(locale); }