Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.Phase


        while (phases.hasNext()) {
            OMElement phaseelement = (OMElement) phases.next();
            String phaseName =
                    phaseelement.getAttribute(new QName(ATTRIBUTE_NAME)).getAttributeValue();
            String phaseClass = phaseelement.getAttributeValue(new QName(TAG_CLASS_NAME));
            Phase phase;

            try {
                phase = getPhase(phaseClass);
            } catch (Exception e) {
                throw new DeploymentException(
                        Messages.getMessage("phaseclassnotfound", phaseClass, e.getMessage()));
            }

            phase.setName(phaseName);

            Iterator handlers = phaseelement.getChildrenWithName(new QName(TAG_HANDLER));

            while (handlers.hasNext()) {
                OMElement omElement = (OMElement) handlers.next();
                HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);

                handler.getRules().setPhaseName(phaseName);
                try {
                    if (Utils.loadHandler(axisConfig.getSystemClassLoader(), handler)) {
                        try {
                            phase.addHandler(handler);
                        } catch (PhaseException e) {
                            throw new DeploymentException(e);
                        }
                    }
                } catch (UnsupportedClassVersionError e) {
View Full Code Here


    }

    private Phase getPhase(String className)
            throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        if (className == null) {
            return new Phase();
        }
        Class phaseClass = Loader.loadClass(axisConfig.getSystemClassLoader(), className);
        return (Phase) phaseClass.newInstance();
    }
View Full Code Here

    return messageBoxOperation;
  }

  private void checkAction(MessageContext msgContext) throws AxisFault {

    Phase addPhase = getAddressingPhase(msgContext);

    if (addPhase == null) {
      logger.error("unable to locate addressing phase object");
    }

    if (msgContext.getCurrentPhaseIndex() + 1 == addPhase.getHandlerCount()) {
      if (msgContext.getAxisService() == null
          || msgContext.getAxisOperation() == null)
        AddressingFaultsHelper.triggerActionNotSupportedFault(
            msgContext, msgContext.getWSAAction());
    }
View Full Code Here

    config = service.getAxisConfiguration();
    phases = config.getInFlowPhases();

    for (Iterator iterator = phases.iterator(); iterator.hasNext();) {
      Phase phase = (Phase) iterator.next();
      if ("Security".equals(phase.getPhaseName())) {
        phase.addHandler(new MyProxySecurityHandler());
        phase.addHandler(new AmazonSecurityHandler());
        return;
      }
    }

  }
View Full Code Here

        return phaseOrderData;
    }

    private void setPhaseDataArray(List phaseList, PhaseData[] phaseData, boolean isGlobalPhase,
                                   int offset, boolean invert) {
        Phase phase;
        for (int i = 0; i < phaseList.size(); i++) {
            phase = (Phase) phaseList.get(i);
            phaseData[offset + i] = getPhaseData(phase, isGlobalPhase, invert);
        }
    }
View Full Code Here

            case PhaseMetadata.IN_FLOW: {
                ArrayList inflow = op.getRemainingPhasesInFlow();
                phaseNames = new String[inflow.size()];

                for (int i = 0; i < inflow.size(); i++) {
                    Phase phase = (Phase) inflow.get(i);
                    phaseNames[i] = phase.getPhaseName();
                }

                break;
            }

            case PhaseMetadata.OUT_FLOW: {
                ArrayList inflow = op.getPhasesOutFlow();
                phaseNames = new String[inflow.size()];

                for (int i = 0; i < inflow.size(); i++) {
                    Phase phase = (Phase) inflow.get(i);
                    phaseNames[i] = phase.getPhaseName();
                }

                break;
            }

            case PhaseMetadata.FAULT_IN_FLOW: {
                ArrayList inflow = op.getPhasesInFaultFlow();
                phaseNames = new String[inflow.size()];

                for (int i = 0; i < inflow.size(); i++) {
                    Phase phase = (Phase) inflow.get(i);
                    phaseNames[i] = phase.getPhaseName();
                }

                break;
            }

            case PhaseMetadata.FAULT_OUT_FLOW: {
                ArrayList inflow = op.getPhasesOutFaultFlow();
                phaseNames = new String[inflow.size()];

                for (int i = 0; i < inflow.size(); i++) {
                    Phase phase = (Phase) inflow.get(i);
                    phaseNames[i] = phase.getPhaseName();
                }

                break;
            }
        }
View Full Code Here

        switch (flow) {
            case PhaseMetadata.IN_FLOW: {
                ArrayList inflow = op.getRemainingPhasesInFlow();

                for (Object anInflow : inflow) {
                    Phase phase = (Phase) anInflow;

                    if (phase.getPhaseName().equals(phaseName)) {
                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
                    }
                }

                break;
            }

            case PhaseMetadata.OUT_FLOW: {
                ArrayList inflow = op.getPhasesOutFlow();

                for (Object anInflow : inflow) {
                    Phase phase = (Phase) anInflow;

                    if (phase.getPhaseName().equals(phaseName)) {
                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
                    }
                }

                break;
            }

            case PhaseMetadata.FAULT_IN_FLOW: {
                ArrayList inflow = op.getPhasesInFaultFlow();

                for (Object anInflow : inflow) {
                    Phase phase = (Phase) anInflow;

                    if (phase.getPhaseName().equals(phaseName)) {
                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
                    }
                }

                break;
            }

            case PhaseMetadata.FAULT_OUT_FLOW: {
                ArrayList inflow = op.getPhasesOutFaultFlow();

                for (Object anInflow : inflow) {
                    Phase phase = (Phase) anInflow;

                    if (phase.getPhaseName().equals(phaseName)) {
                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
View Full Code Here

     * inconsistent state (which can happen when a configuration change is taking place).
     */
    private void addRequestBlockingHandlerToInFlows() {
        AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
        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);

                    log.debug("Added " + ClusteringConstants.REQUEST_BLOCKING_HANDLER +
                              " between SOAPMessageBodyBasedDispatcher & InstanceDispatcher to InFaultFlow");
                    break;
                }
View Full Code Here

        while (phases.hasNext()) {
            OMElement phaseelement = (OMElement) phases.next();
            String phaseName =
                    phaseelement.getAttribute(new QName(ATTRIBUTE_NAME)).getAttributeValue();
            String phaseClass = phaseelement.getAttributeValue(new QName(TAG_CLASS_NAME));
            Phase phase;

            try {
                phase = getPhase(phaseClass);
            } catch (Exception e) {
                throw new DeploymentException(
                        Messages.getMessage("phaseclassnotfound", phaseClass, e.getMessage()));
            }

            phase.setName(phaseName);

            Iterator handlers = phaseelement.getChildrenWithName(new QName(TAG_HANDLER));

            while (handlers.hasNext()) {
                OMElement omElement = (OMElement) handlers.next();
                HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);

                handler.getRules().setPhaseName(phaseName);
                try {
                    if (Utils.loadHandler(axisConfig.getSystemClassLoader(), handler)) {
                        try {
                            phase.addHandler(handler);
                        } catch (PhaseException e) {
                            throw new DeploymentException(e);
                        }
                    }
                } catch (UnsupportedClassVersionError e) {
View Full Code Here

    }

    private Phase getPhase(String className)
            throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        if (className == null) {
            return new Phase();
        }
        Class phaseClass = Loader.loadClass(axisConfig.getSystemClassLoader(), className);
        return (Phase) phaseClass.newInstance();
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.Phase

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.