Package org.apache.axis2.description

Examples of org.apache.axis2.description.HandlerDescription


            Handler han = null;
            PhaseHolder ph = new PhaseHolder(inPhase);


            HandlerDescription hm = new HandlerDescription();
            hm.setClassName("org.apache.axis2.handlers.AbstractHandler");
            hm.setHandler(han);
            hm.setName(new QName("H1"));
            PhaseRule rule = new PhaseRule();
            rule.setPhaseName("global");
            rule.setPhaseFirst(true);
            hm.setRules(rule);
            ph.addHandler(hm);

            HandlerDescription hm1 = new HandlerDescription();
            hm1.setClassName("org.apache.axis2.handlers.AbstractHandler");
            hm1.setHandler(han);
            hm1.setName(new QName("H2"));
            PhaseRule rule1 = new PhaseRule();
            rule1.setPhaseName("global");
            rule1.setAfter("H1");
            hm1.setRules(rule1);
            ph.addHandler(hm1);

            HandlerDescription hm3 = new HandlerDescription();
            hm3.setClassName("org.apache.axis2.handlers.AbstractHandler");
            hm3.setHandler(han);
            hm3.setName(new QName("H4"));
            PhaseRule rule3 = new PhaseRule();
            rule3.setPhaseName("Logging");
            hm3.setRules(rule3);
            ph.addHandler(hm3);
            fail("this must failed gracefully with PhaseException ");
        } catch (Exception e) {
            log.info(e.getMessage());
        }
View Full Code Here


            Handler han = null;
            PhaseHolder ph = new PhaseHolder(inPhase);


            HandlerDescription hm = new HandlerDescription();
            hm.setClassName("org.apache.axis2.handlers.AbstractHandler");
            hm.setHandler(han);
            hm.setName(new QName("H1"));
            PhaseRule rule = new PhaseRule();
            rule.setPhaseName("global");
            rule.setPhaseFirst(true);
            rule.setPhaseLast(true);
            hm.setRules(rule);
            ph.addHandler(hm);

            HandlerDescription hm1 = new HandlerDescription();
            hm1.setClassName("org.apache.axis2.handlers.AbstractHandler");
            hm1.setHandler(han);
            hm1.setName(new QName("H2"));
            PhaseRule rule1 = new PhaseRule();
            rule1.setPhaseName("global");
            rule1.setAfter("H1");
            hm1.setRules(rule1);
            ph.addHandler(hm1);

            fail("this must failed gracefully with PhaseException ");
        } catch (Exception e) {
            log.info(e.getMessage());
View Full Code Here

        private boolean pause = false;

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

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

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

    }

    HandlerDescription makeHandler(OMElement handlerElement) {
        String name = handlerElement.getAttributeValue(new QName("name"));
        QName qname = handlerElement.resolveQName(name);
        HandlerDescription desc = new HandlerDescription(qname.getLocalPart());
        String className = handlerElement.getAttributeValue(new QName("class"));

        desc.setClassName(className);

        return desc;
    }
View Full Code Here

        Phase phase = new Phase(phaseName);
        Iterator children = phaseElement.getChildElements();

        while (children.hasNext()) {
            OMElement handlerElement = (OMElement) children.next();
            HandlerDescription handlerDesc = makeHandler(handlerElement);

            phase.addHandler(handlerDesc);
        }

        return phase;
View Full Code Here

  public static void addFlowHandlers(Flow flow, ClassLoader clsLoader)
      throws AxisFault {
    int count = flow.getHandlerCount();

    for (int j = 0; j < count; j++) {
      HandlerDescription handlermd = flow.getHandler(j);
      Handler handler;

      final Class handlerClass = getHandlerClass(
          handlermd.getClassName(), clsLoader);

      try {
        handler = (Handler) org.apache.axis2.java.security.AccessController
            .doPrivileged(new PrivilegedExceptionAction() {
              public Object run() throws InstantiationException,
                  IllegalAccessException {
                return handlerClass.newInstance();
              }
            });
        handler.init(handlermd);
        handlermd.setHandler(handler);
      } catch (PrivilegedActionException e) {
        throw AxisFault.makeFault(e);
      }
    }
  }
View Full Code Here

        }
    }

    @Override
    public void initDispatcher() {
        init(new HandlerDescription(NAME));
    }
View Full Code Here

    public static final String NAME = "MultitenantDispatcher";

    public void initDispatcher() {
        QName qn = new QName("http://wso2.org/projects/carbon", NAME);
        HandlerDescription hd = new HandlerDescription(qn.getLocalPart());
        super.init(hd);
    }
View Full Code Here

     *
     * @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);

        List<Phase> inflowPhases
                = mainAxisConfig.getInFlowPhases();
        for (Phase inPhase : inflowPhases) {
            // we are interested about the Dispatch phase in the inflow
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.