Examples of PhaseRule


Examples of org.apache.axis2.description.PhaseRule

     * @param mainAxisConfig super-tenant AxisConfiguration
     * @throws org.apache.axis2.AxisFault if an error occurs while adding the dispatcher
     */
    private void addDispatchers(AxisConfiguration mainAxisConfig) throws AxisFault {
        HandlerDescription handlerDescription = new HandlerDescription(MultitenantDispatcher.NAME);
        PhaseRule rule = new PhaseRule(PhaseMetadata.PHASE_DISPATCH);
        rule.setAfter(HTTPLocationBasedDispatcher.NAME);
        rule.setBefore("SynapseDispatcher");
        handlerDescription.setRules(rule);

        MultitenantDispatcher multitenantDispatcher = new MultitenantDispatcher();
        multitenantDispatcher.initDispatcher();
        handlerDescription.setHandler(multitenantDispatcher);
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

        for (Object o : axisConfig.getInFlowPhases()) {
            Phase phase = (Phase) o;
            if (phase instanceof DispatchPhase) {
                RequestBlockingHandler requestBlockingHandler = new RequestBlockingHandler();
                if (!phase.getHandlers().contains(requestBlockingHandler)) {
                    PhaseRule rule = new PhaseRule("Dispatch");
                    rule.setAfter("SOAPMessageBodyBasedDispatcher");
                    rule.setBefore("InstanceDispatcher");
                    HandlerDescription handlerDesc = requestBlockingHandler.getHandlerDesc();
                    handlerDesc.setHandler(requestBlockingHandler);
                    handlerDesc.setName(ClusteringConstants.REQUEST_BLOCKING_HANDLER);
                    handlerDesc.setRules(rule);
                    phase.addHandler(requestBlockingHandler);

                    log.debug("Added " + ClusteringConstants.REQUEST_BLOCKING_HANDLER +
                              " between SOAPMessageBodyBasedDispatcher & InstanceDispatcher to InFlow");
                    break;
                }
            }
        }
        for (Object o : axisConfig.getInFaultFlowPhases()) {
            Phase phase = (Phase) o;
            if (phase instanceof DispatchPhase) {
                RequestBlockingHandler requestBlockingHandler = new RequestBlockingHandler();
                if (!phase.getHandlers().contains(requestBlockingHandler)) {
                    PhaseRule rule = new PhaseRule("Dispatch");
                    rule.setAfter("SOAPMessageBodyBasedDispatcher");
                    rule.setBefore("InstanceDispatcher");
                    HandlerDescription handlerDesc = requestBlockingHandler.getHandlerDesc();
                    handlerDesc.setHandler(requestBlockingHandler);
                    handlerDesc.setName(ClusteringConstants.REQUEST_BLOCKING_HANDLER);
                    handlerDesc.setRules(rule);
                    phase.addHandler(requestBlockingHandler);
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

        Handler h1 = new PhaseRuleHandler();
        h1.init(hm);
        ((PhaseRuleHandler) h1).setName("PhaseFirstHandler");
        hm.setHandler(h1);
        hm.setName("H1");
        PhaseRule rule = new PhaseRule();
        rule.setPhaseName("PhaseA");
        rule.setPhaseFirst(true);
        hm.setRules(rule);
        ph.addHandler(hm);

        HandlerDescription hm1 = new HandlerDescription();
        hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h2 = new PhaseRuleHandler();
        ((PhaseRuleHandler) h2).setName("Second Handler");
        h2.init(hm1);
        hm1.setHandler(h2);
        hm1.setName("H2");
        PhaseRule rule1 = new PhaseRule();
        rule1.setPhaseName("PhaseA");
        rule1.setBefore("H1");
        hm1.setRules(rule1);
        try {
            ph.addHandler(hm1);
        } catch (PhaseException e) {
            return;
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

        Handler h1 = new PhaseRuleHandler();
        h1.init(hm);
        ((PhaseRuleHandler) h1).setName("PhaseLast");
        hm.setHandler(h1);
        hm.setName("H1");
        PhaseRule rule = new PhaseRule();
        rule.setPhaseName("PhaseA");
        rule.setPhaseLast(true);
        hm.setRules(rule);
        ph.addHandler(hm);

        HandlerDescription hm1 = new HandlerDescription();
        hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h2 = new PhaseRuleHandler();
        ((PhaseRuleHandler) h2).setName("Second Handler");
        h2.init(hm1);
        hm1.setHandler(h2);
        hm1.setName("H2");
        PhaseRule rule1 = new PhaseRule();
        rule1.setPhaseName("PhaseA");
        rule1.setAfter("H1");
        hm1.setRules(rule1);
        try {
            ph.addHandler(hm1);
        } catch (PhaseException e) {
            return;
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

        hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h1 = new PhaseRuleHandler();
        h1.init(hm);
        hm.setHandler(h1);
        hm.setName("H1");
        PhaseRule rule = new PhaseRule();
        rule.setPhaseName("PreDispatch");
        rule.setPhaseFirst(true);
        hm.setRules(rule);
        ph.addHandler(hm);

        HandlerDescription hm1 = new HandlerDescription();
        hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h2 = new PhaseRuleHandler();
        h2.init(hm1);
        hm1.setHandler(h2);
        hm1.setName("H2");
        PhaseRule rule1 = new PhaseRule();
        rule1.setPhaseName("PreDispatch");
        rule1.setAfter("H1");
        hm1.setRules(rule1);
        ph.addHandler(hm1);

        HandlerDescription hm2 = new HandlerDescription();
        hm2.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h3 = new PhaseRuleHandler();
        h3.init(hm2);
        hm2.setHandler(h3);
        hm2.setName("H3");
        PhaseRule rule2 = new PhaseRule();
        rule2.setPhaseName("PreDispatch");
        rule2.setAfter("H1");
        rule2.setBefore("H2");
        hm2.setRules(rule2);
        ph.addHandler(hm2);

        HandlerDescription hm3 = new HandlerDescription();
        hm3.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h4 = new PhaseRuleHandler();
        h4.init(hm3);
        hm3.setHandler(h4);
        hm3.setName("H4");
        PhaseRule rule3 = new PhaseRule();
        rule3.setPhaseName("Dispatch");
        hm3.setRules(rule3);
        ph.addHandler(hm3);
    }
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

        Handler h1 = new PhaseRuleHandler();
        h1.init(hm);
        ((PhaseRuleHandler) h1).setName("PhaseFirstHandler");
        hm.setHandler(h1);
        hm.setName("H1");
        PhaseRule rule = new PhaseRule();
        rule.setPhaseName("PhaseA");
        rule.setPhaseFirst(true);
        rule.setPhaseLast(true);
        hm.setRules(rule);
        ph.addHandler(hm);

        HandlerDescription hm1 = new HandlerDescription();
        hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
        Handler h2 = new PhaseRuleHandler();
        ((PhaseRuleHandler) h2).setName("Second Handler");
        h2.init(hm1);
        hm1.setHandler(h2);
        hm1.setName("H2");
        PhaseRule rule1 = new PhaseRule();
        rule1.setPhaseName("PhaseA");
        rule1.setAfter("H1");
        hm1.setRules(rule1);
        try {
            ph.addHandler(hm1);
        } catch (PhaseException e) {
            // Caught expected Exception
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

        Handler h1 = new PhaseRuleHandler();
        h1.init(hm);
        ((PhaseRuleHandler) h1).setName("PhaseFirstHandler");
        hm.setHandler(h1);
        hm.setName("H1");
        PhaseRule rule = new PhaseRule();
        rule.setPhaseName("PhaseA");
        rule.setPhaseFirst(true);
        rule.setBefore("H2");
        hm.setRules(rule);
        try {
            // This should fail
            ph.addHandler(hm);
            fail("Incorrectly added Handler with both PhaseFirst and before name");
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

            Handler h1 = new PhaseRuleHandler();
            h1.init(hm);
            ((PhaseRuleHandler) h1).setName("PhaseFirstHandler");
            hm.setHandler(h1);
            hm.setName("H1");
            PhaseRule rule = new PhaseRule();
            rule.setPhaseName("PhaseA");
            rule.setPhaseFirst(true);
            hm.setRules(rule);
            ph.addHandler(hm);

            HandlerDescription hm1 = new HandlerDescription();
            hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
            Handler h2 = new PhaseRuleHandler();
            ((PhaseRuleHandler) h2).setName("Second Handler");
            h2.init(hm1);
            hm1.setHandler(h2);
            hm1.setName("H2");
            PhaseRule rule1 = new PhaseRule();
            rule1.setPhaseName("PhaseA");
            rule1.setPhaseFirst(true);
            hm1.setRules(rule1);
            ph.addHandler(hm1);
            fail("This should be faild with PhaseFirst already has been set, cannot have two " +
                    "phaseFirst Handler for same phase ");
        } catch (AxisFault axisFault) {
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

        Handler h1 = new PhaseRuleHandler();
        h1.init(hm);
        ((PhaseRuleHandler) h1).setName("PhaseFirstHandler");
        hm.setHandler(h1);
        hm.setName("H1");
        PhaseRule rule = new PhaseRule();
        rule.setPhaseName("PhaseA");
        rule.setPhaseLast(true);
        rule.setBefore("H2");
        hm.setRules(rule);
        try {
            ph.addHandler(hm);
        } catch (PhaseException e) {
            return;
View Full Code Here

Examples of org.apache.axis2.description.PhaseRule

            Handler h1 = new PhaseRuleHandler();
            h1.init(hm);
            ((PhaseRuleHandler) h1).setName("PhaseLast");
            hm.setHandler(h1);
            hm.setName("H1");
            PhaseRule rule = new PhaseRule();
            rule.setPhaseName("PhaseA");
            rule.setPhaseLast(true);
            hm.setRules(rule);
            ph.addHandler(hm);

            HandlerDescription hm1 = new HandlerDescription();
            hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
            Handler h2 = new PhaseRuleHandler();
            ((PhaseRuleHandler) h2).setName("Second Handler");
            h2.init(hm1);
            hm1.setHandler(h2);
            hm1.setName("H2");
            PhaseRule rule1 = new PhaseRule();
            rule1.setPhaseName("PhaseA");
            rule1.setPhaseLast(true);
            hm1.setRules(rule1);
            ph.addHandler(hm1);
            fail("This should be faild with Phaselast already has been set, cannot have two " +
                    "phaseLast Handler for same phase ");
        } catch (AxisFault axisFault) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.