/** * Initializes action result. */ protected void initializeResult(final ActionResult result) { contextInjectorComponent.injectContext(result); }
private InterceptorsManager createInterceptorManager() { PetiteContainer madpc = new PetiteContainer(); madpc.addSelf("madpc"); madpc.addBean("madvocEncoding", new MadvocEncoding()); InterceptorsManager im = new InterceptorsManager(); im.contextInjectorComponent = new ContextInjectorComponent(); im.contextInjectorComponent.madvocController = new MadvocController(); im.contextInjectorComponent.madvocController.servletContextProvider = new ServletContextProvider(null); im.contextInjectorComponent.scopeDataInspector = new ScopeDataInspector(); im.contextInjectorComponent.scopeResolver = new ScopeResolver(); im.contextInjectorComponent.scopeResolver.madpc = madpc; return im; }
protected ActionConfig createActionConfig(final Class<? extends ActionConfig> actionConfigClass) { try { final Constructor<? extends ActionConfig> ctor = actionConfigClass.getDeclaredConstructor(); final ActionConfig actionConfig = ctor.newInstance(); contextInjectorComponent.injectContext(actionConfig); return actionConfig; } catch (Exception ex) { throw new MadvocException("Invalid action configuration class: " + actionConfigClass.getSimpleName(), ex); } } }
/** * Initializes action wrapper. */ protected void initializeWrapper(final T wrapper) { contextInjectorComponent.injectContext(wrapper); wrapper.init(); }
/** * Parses action class and method and creates {@link ActionDefinition parsed action definition}. */ public ActionDefinition parseActionDefinition(final Class<?> actionClass, final Method actionMethod) { final ActionAnnotationValues annotationValues = detectActionAnnotationValues(actionMethod); final ActionConfig actionConfig = resolveActionConfig(annotationValues); final String[] packageActionNames = readPackageActionPath(actionClass); final String[] classActionNames = readClassActionPath(actionClass); final String[] methodActionNames = readMethodActionPath(actionMethod.getName(), annotationValues, actionConfig); final String method = readMethodHttpMethod(actionMethod); final ActionNames actionNames = new ActionNames(packageActionNames, classActionNames, methodActionNames, method); final ActionNamingStrategy namingStrategy; try { namingStrategy = ClassUtil.newInstance(actionConfig.getNamingStrategy()); contextInjectorComponent.injectContext(namingStrategy); } catch (Exception ex) { throw new MadvocException(ex); } return namingStrategy.buildActionDef(actionClass, actionMethod, actionNames); }