📄 vraptorexecution.java
字号:
package xyz.frame.core;import org.apache.log4j.Logger;import xyz.frame.LogicException;import xyz.frame.component.ComponentNotFoundException;import xyz.frame.component.ComponentType;import xyz.frame.component.LogicMethod;import xyz.frame.component.LogicNotFoundException;import xyz.frame.interceptor.InterceptorInstantiationException;import xyz.frame.url.InternalLogicRequest;import xyz.frame.view.ViewException;/** * Xyz's engine. * * @author Guilherme Silveira */public class XyzExecution { private static final Logger logger = Logger .getLogger(XyzExecution.class); private XyzController controller; private InternalLogicRequest request; private String result; public XyzExecution(InternalLogicRequest logicRequest, XyzController controller) { this.controller = controller; this.request = logicRequest; } public String execute() throws ComponentNotFoundException, LogicNotFoundException, ViewException, InterceptorInstantiationException, LogicException { logger.debug("Calling execute on " + request.toString()); ComponentType componentClass = this.controller.getWebApplication() .getComponentManager().getComponent(request); // gets the logic method LogicMethod logicMethod = componentClass.getLogic(request .getLogicName()); // gets the flow ExecuteLogicInterceptor interceptor = new ExecuteLogicInterceptor(this, componentClass, logicMethod); BasicLogicFlow logicFlow = new BasicLogicFlow(componentClass, this, interceptor); // executes it logicFlow.execute(); // returns its result, if any return this.result; } public void redirect(String result) throws ViewException { // forward logger.debug("Logic returned redirect to: " + result); this.controller.getWebApplication().getViewManager().forward(request, result, request.getRequest(), request.getResponse()); // everything went fine... this.result = result; } /** * Returns its request object * * @return the request */ InternalLogicRequest getRequest() { return request; } /** * Returns xyz's controller * * @return the controller */ XyzController getController() { return controller; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -