Package com.astamuse.asta4d.web.dispatch.mapping

Examples of com.astamuse.asta4d.web.dispatch.mapping.UrlMappingRule$UnModifiableUrlMappingRule


            }
        }

        // config remapped rule
        Object reMapId;
        UrlMappingRule copyFromRule;
        for (UrlMappingRule rule : arrangedRuleList) {
            reMapId = rule.extraVar(REMAP_ID_VAR_NAME);
            if (reMapId == null) {
                continue;
            }
            copyFromRule = searchRuleById(arrangedRuleList, reMapId.toString());
            rule.setAttributeList(new ArrayList<>(copyFromRule.getAttributeList()));
            rule.setExtraVarMap(new HashMap<>(copyFromRule.getExtraVarMap()));
            rule.setHandlerList(new ArrayList<>(copyFromRule.getHandlerList()));
            rule.setInterceptorList(new ArrayList<>(copyFromRule.getInterceptorList()));
            rule.setPriority(copyFromRule.getPriority());
            rule.setResultTransformerList(new ArrayList<>(copyFromRule.getResultTransformerList()));
        }

        Collections.sort(arrangedRuleList, new Comparator<UrlMappingRule>() {
            @Override
            public int compare(UrlMappingRule r1, UrlMappingRule r2) {
View Full Code Here


        return arrangedRuleList;
    }

    private UrlMappingRule createDefaultRule(HttpMethod method, String sourcePath) {
        UrlMappingRule rule = new UrlMappingRule();
        ruleList.add(rule);

        rule.setMethod(method);
        rule.setSourcePath(sourcePath);
        rule.setSeq(Sequencer.incrementAndGet());
        rule.setPriority(DEFAULT_PRIORITY);

        return rule;
    }
View Full Code Here

        HandyRuleWithRemap handyRule = new HandyRuleWithRemap(createDefaultRule(method, sourcePath));
        return handyRule;
    }

    public HandyRuleWithAttrOnly add(HttpMethod method, String sourcePath, String targetPath) {
        UrlMappingRule rule = createDefaultRule(method, sourcePath);
        HandyRule handyRule = new HandyRule(rule);
        handyRule.forward(targetPath);
        return new HandyRuleWithAttrOnly(rule);
    }
View Full Code Here

    public void addGlobalRedirect(Object result, String targetPath) {
        forwardHolderList.add(new GlobalForwardHolder(result, targetPath, null, true));
    }

    private UrlMappingRule searchRuleById(List<UrlMappingRule> list, String id) {
        UrlMappingRule result = null;
        Object ruleId;
        for (UrlMappingRule rule : list) {
            ruleId = rule.extraVar(ID_VAR_NAME);
            if (ruleId == null) {
                continue;
View Full Code Here

            }
        }

        // config remapped rule
        Object reMapId;
        UrlMappingRule copyFromRule;
        for (UrlMappingRule rule : arrangedRuleList) {
            reMapId = rule.extraVar(REMAP_ID_VAR_NAME);
            if (reMapId == null) {
                continue;
            }
            copyFromRule = searchRuleById(arrangedRuleList, reMapId.toString());
            rule.setAttributeList(new ArrayList<>(copyFromRule.getAttributeList()));
            rule.setExtraVarMap(new HashMap<>(copyFromRule.getExtraVarMap()));
            rule.setHandlerList(new ArrayList<>(copyFromRule.getHandlerList()));
            rule.setInterceptorList(new ArrayList<>(copyFromRule.getInterceptorList()));
            rule.setPriority(copyFromRule.getPriority());
            rule.setResultTransformerList(new ArrayList<>(copyFromRule.getResultTransformerList()));
        }

        Collections.sort(arrangedRuleList, new Comparator<UrlMappingRule>() {
            @Override
            public int compare(UrlMappingRule r1, UrlMappingRule r2) {
View Full Code Here

        return arrangedRuleList;
    }

    private UrlMappingRule createDefaultRule(HttpMethod method, String sourcePath) {
        UrlMappingRule rule = new UrlMappingRule();
        ruleList.add(rule);

        rule.setMethod(method);
        rule.setSourcePath(sourcePath);
        rule.setSeq(Sequencer.incrementAndGet());
        rule.setPriority(DEFAULT_PRIORITY);

        return rule;
    }
View Full Code Here

        HandyRuleWithRemap handyRule = new HandyRuleWithRemap(createDefaultRule(method, sourcePath));
        return handyRule;
    }

    public HandyRuleWithAttrOnly add(HttpMethod method, String sourcePath, String targetPath) {
        UrlMappingRule rule = createDefaultRule(method, sourcePath);
        HandyRule handyRule = new HandyRule(rule);
        handyRule.forward(targetPath);
        return new HandyRuleWithAttrOnly(rule);
    }
View Full Code Here

            logger.debug("apply rule at :" + result.getRule());
        }

        writePathVarToContext(context, result.getPathVarMap());

        UrlMappingRule rule = result.getRule();
        context.setData(KEY_CURRENT_RULE, rule);
        writePathVarToContext(context, rule.getExtraVarMap());
        retrieveFlashScopeData(request);

        List<ContentProvider<?>> requestResult = handleRequest(rule);
        ContentWriter cw;
        for (ContentProvider<?> cp : requestResult) {
View Full Code Here

            logger.debug("apply rule at :" + result.getRule());
        }

        writePathVarToContext(context, result.getPathVarMap());

        UrlMappingRule rule = result.getRule();
        context.setData(KEY_CURRENT_RULE, rule);
        writePathVarToContext(context, rule.getExtraVarMap());
        restoreFlashScopeData(context, request);

        List<ContentProvider> requestResult = handleRequest(rule);
        for (ContentProvider cp : requestResult) {
            cp.produce(rule, response);
View Full Code Here

    public void addGlobalRedirect(Object result, String targetPath) {
        forwardHolderList.add(new GlobalForwardHolder(result, targetPath, null, true));
    }

    private UrlMappingRule searchRuleById(List<UrlMappingRule> list, String id) {
        UrlMappingRule result = null;
        Object ruleId;
        for (UrlMappingRule rule : list) {
            ruleId = rule.extraVar(ID_VAR_NAME);
            if (ruleId == null) {
                continue;
View Full Code Here

TOP

Related Classes of com.astamuse.asta4d.web.dispatch.mapping.UrlMappingRule$UnModifiableUrlMappingRule

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.