Package net.paoding.rose.web.impl.thread

Examples of net.paoding.rose.web.impl.thread.InvocationBean


    public String module(Invocation inv) {
        return "3" + inv.getRequestPath().getModulePath();
    }

    public Engine moduleEngine(Invocation inv) {
        InvocationBean invb = (InvocationBean) inv;
        return invb.getModuleEngine();
    }
View Full Code Here


        InvocationBean invb = (InvocationBean) inv;
        return invb.getModuleEngine();
    }

    public Engine controllerEngine(Invocation inv) {
        InvocationBean invb = (InvocationBean) inv;
        return invb.getControllerEngine();
    }
View Full Code Here

        InvocationBean invb = (InvocationBean) inv;
        return invb.getControllerEngine();
    }

    public Engine actionEngine(Invocation inv) {
        InvocationBean invb = (InvocationBean) inv;
        return invb.getActionEngine();
    }
View Full Code Here

        return sb.toString();
    }

    @Get("method")
    public Object method(Invocation pinv) {
        InvocationBean inv = (InvocationBean) pinv;
        RequestPath curpath = inv.getRequestPath();
        String testUri = inv.getRequest().getQueryString(); // queryString as uri
        if (testUri == null || testUri.length() == 0) {
            return "@e.g. <a href='/rose-info/method?get=/rose-info/tree'>/rose-info/method?get=/rose-info/tree</a>";
        }
        ReqMethod testMethod = curpath.getMethod();
        if (testUri.indexOf('=') > 0) {
            int index = testUri.indexOf('=');
            testMethod = ReqMethod.parse(testUri.substring(0, index));
            testUri = testUri.substring(index + 1);
        }
        if (!testUri.startsWith(curpath.getCtxpath())) {
            return "@wrong uri:" + testUri;
        }
        MappingNode tree = inv.getRose().getMappingTree();
        RequestPath testPath = new RequestPath(//
                testMethod, testUri, curpath.getCtxpath(), curpath.getDispatcher());
        //
        ArrayList<MatchResult> matchResults = tree.match(testPath);
        if (matchResults == null) {
            // not rose uri
            return ("@404: <br>not rose uri: '" + testUri + "'");
        }

        final MatchResult lastMatched = matchResults.get(matchResults.size() - 1);
        final EngineGroup leafEngineGroup = lastMatched.getMappingNode().getLeafEngines();
        final LinkedEngine leafEngine = select(leafEngineGroup.getEngines(testMethod), inv
                .getRequest());
        if (leafEngine == null) {
            if (leafEngineGroup.size() == 0) {
                // not rose uri
                return ("@404: <br>not rose uri, not exits leaf engines for it: '" + testUri + "'");
View Full Code Here

*/
public class ParentErrorHandlerImpl implements ParentErrorHandler {

    @Override
    public Object onError(Invocation inv, Throwable ex) throws Throwable {
        InvocationBean invb = (InvocationBean) inv;
        Module module = invb.getModule();
        while ((module = module.getParent()) != null) {
            ControllerErrorHandler handler;
            if ((handler = module.getErrorHandler()) != null) {
                return handler.onError(invb, ex);
            }
View Full Code Here

TOP

Related Classes of net.paoding.rose.web.impl.thread.InvocationBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.