Package org.apache.axis2.description

Examples of org.apache.axis2.description.HandlerDescription


            phases.add(p1);
            Phase p2 = new Phase("PhaseB");
            phases.add(p2);

            PhaseHolder ph = new PhaseHolder(phases);
            HandlerDescription hm = new HandlerDescription();
            hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
            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


     *
     * @throws Exception if there's an error
     */
    public void testBadBeforeAndAfters() throws Exception {
        PhaseRuleHandler h1 = new PhaseRuleHandler("a");
        HandlerDescription hd = new HandlerDescription("a");
        h1.init(hd);

        PhaseRuleHandler h2 = new PhaseRuleHandler("c");
        hd = new HandlerDescription("c");
        h2.init(hd);

        Phase phase = new Phase();
        phase.addHandler(h1);
        phase.addHandler(h2);

        PhaseRule badRule = new PhaseRule();
        badRule.setBefore("a");
        badRule.setAfter("c");

        hd = new HandlerDescription("b");
        PhaseRuleHandler h3 = new PhaseRuleHandler("b");
        h3.init(hd);

        hd.setHandler(h3);
        hd.setRules(badRule);
        try {
            phase.addHandler(hd);
            fail("Bad PhaseRule was accepted!");
        } catch (PhaseException e) {
            // Correct - exception caught
View Full Code Here

        }

        public TempHandler(int index, boolean pause) {
            this.handlerID = new Integer(index);
            this.pause = pause;
            init(new HandlerDescription("handler" + index));
        }
View Full Code Here

            init(new HandlerDescription("handler" + index));
        }

        public TempHandler(int index) {
            this.handlerID = new Integer(index);
            init(new HandlerDescription("handler" + index));
        }
View Full Code Here

                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);
                }
                break;
            }
        }
        for (Iterator iterator = axisConfig.getInFaultFlowPhases().iterator();
             iterator.hasNext();) {
            Phase phase = (Phase) iterator.next();
            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);
                    break;
                }
            }
        }
View Full Code Here

        inPhase.add(preDispatch);
        inPhase.add(dispatchPhase);
        PhaseHolder ph = new PhaseHolder(inPhase);


        HandlerDescription pre = new HandlerDescription();
        pre.setClassName("org.apache.axis2.handlers.AbstractHandler");
        Handler h1 = new PhaseRuleHandler();
        h1.init(pre);
        pre.setHandler(h1);
        pre.setName("pre-H1");
        PhaseRule pre_rule1 = new PhaseRule();
        pre_rule1.setPhaseName("PreDispatch");
        pre.setRules(pre_rule1);
        ph.addHandler(pre);

        HandlerDescription pre2 = new HandlerDescription();
        pre2.setClassName("org.apache.axis2.handlers.AbstractHandler");
        Handler h2 = new PhaseRuleHandler();
        h2.init(pre2);
        pre2.setHandler(h2);
        pre2.setName("dispatch");
        PhaseRule prerule2 = new PhaseRule();
        prerule2.setPhaseName("Dispatch");
        pre2.setRules(prerule2);
        ph.addHandler(pre2);


        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.handlers.AbstractHandler");
        Handler h3 = new PhaseRuleHandler();
        h3.init(hm);
        hm.setHandler(h3);
        hm.setName("pre-H2");
        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.handlers.AbstractHandler");
        Handler h4 = new PhaseRuleHandler();
        h4.init(hm1);
        hm1.setHandler(h4);
        hm1.setName("pre-H3");
        PhaseRule rule1 = new PhaseRule();
        rule1.setPhaseName("PreDispatch");
        rule1.setAfter("pre-H2");
        hm1.setRules(rule1);
        ph.addHandler(hm1);

        HandlerDescription hm2 = new HandlerDescription();
        hm2.setClassName("org.apache.axis2.handlers.AbstractHandler");
        Handler h5 = new PhaseRuleHandler();
        h5.init(hm2);
        hm2.setHandler(h5);
        hm2.setName("H3");
        PhaseRule rule2 = new PhaseRule();
        rule2.setPhaseName("PreDispatch");
        rule2.setAfter("pre-H2");
        rule2.setBefore("pre-H3");
        hm2.setRules(rule2);
        ph.addHandler(hm2);

        /*ArrayList oh = ph.getOrderHandler();
        for (int i = 0; i < oh.size(); i++) {
            HandlerDescription metadata = (HandlerDescription) oh.get(i);
View Full Code Here

        Phase phase = new Phase();

        //////////////// handler 1 //////////////////////////
        PhaseRuleHandler h1 = new PhaseRuleHandler("a");
        HandlerDescription hd1 = new HandlerDescription("a");
        h1.init(hd1);
        hd1.setHandler(h1);
        phase.addHandler(hd1);
        /////////////////////////////////////////////////////

        //////////////// handler 4 //////////////////////////
        PhaseRule rule4 = new PhaseRule();
        rule4.setPhaseLast(true);

        PhaseRuleHandler h4 = new PhaseRuleHandler("d");
        HandlerDescription hd4 = new HandlerDescription("d");
        h4.init(hd4);

        hd4.setHandler(h4);
        hd4.setRules(rule4);
        phase.addHandler(hd4);
        ////////////////////////////////////////////////////

        //////////////// handler 2 //////////////////////////
        PhaseRule rule2 = new PhaseRule();
        rule2.setAfter("a");

        HandlerDescription hd2 = new HandlerDescription("b");
        PhaseRuleHandler h2 = new PhaseRuleHandler("b");
        h2.init(hd2);

        hd2.setHandler(h2);
        hd2.setRules(rule2);
        phase.addHandler(hd2);
        //////////////////////////////////////////////////////

        //////////////// handler 3 //////////////////////////
        PhaseRule rule3 = new PhaseRule();
        rule3.setAfter("b");

        HandlerDescription hd3 = new HandlerDescription("c");
        PhaseRuleHandler h3 = new PhaseRuleHandler("c");
        h3.init(hd3);

        hd3.setHandler(h3);
        hd3.setRules(rule3);
        try {
            phase.addHandler(hd3);
        } catch (Exception e) {
            fail("Adding handlers with after attribute to the phase behaviour failed");
        }
View Full Code Here

        dispatchPhase.setName("Dispatch");
        inPhase.add(transportIN);
        inPhase.add(preDispatch);
        inPhase.add(dispatchPhase);

        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.handlers.AbstractHandler");
        Handler h1 = new PhaseRuleHandler();
        hm.setHandler(h1);
        hm.getRules().setPhaseName("*");

        PhaseHolder ph = new PhaseHolder(inPhase);
        ph.addHandler(hm);
        boolean found;
        for (int i = 0; i < inPhase.size(); i++) {
View Full Code Here

        dispatchPhase.setName("Dispatch");
        inPhase.add(transportIN);
        inPhase.add(preDispatch);
        inPhase.add(dispatchPhase);

        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.handlers.AbstractHandler");
        Handler h1 = new PhaseRuleHandler();
        hm.setHandler(h1);
        hm.getRules().setPhaseName("*");
        hm.getRules().setPhaseFirst(true);

        PhaseHolder ph = new PhaseHolder(inPhase);
        ph.addHandler(hm);
        for (int i = 0; i < inPhase.size(); i++) {
            Phase phase = (Phase) inPhase.get(i);
View Full Code Here

        dispatchPhase.setName("Dispatch");
        inPhase.add(transportIN);
        inPhase.add(preDispatch);
        inPhase.add(dispatchPhase);

        HandlerDescription hm = new HandlerDescription();
        hm.setClassName("org.apache.axis2.handlers.AbstractHandler");
        Handler h1 = new PhaseRuleHandler();
        hm.setHandler(h1);
        hm.getRules().setPhaseName("*");
        hm.getRules().setPhaseFirst(true);

        PhaseHolder ph = new PhaseHolder(inPhase);
        ph.addHandler(hm);
        for (int i = 0; i < inPhase.size(); i++) {
            Phase phase = (Phase) inPhase.get(i);
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.HandlerDescription

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.