Package org.apache.axis2.description

Examples of org.apache.axis2.description.Flow


            currentDeploymentFile.setClassLoader(false, config.getModuleClassLoader(), null);
            axismodule.setModuleClassLoader(currentDeploymentFile.getClassLoader());
            archiveReader.readModuleArchive(currentDeploymentFile, axismodule,
                                            false, config);
            ClassLoader moduleClassLoader = axismodule.getModuleClassLoader();
            Flow inflow = axismodule.getInFlow();

            if (inflow != null) {
                Utils.addFlowHandlers(inflow, moduleClassLoader);
            }

            Flow outFlow = axismodule.getOutFlow();

            if (outFlow != null) {
                Utils.addFlowHandlers(outFlow, moduleClassLoader);
            }

            Flow faultInFlow = axismodule.getFaultInFlow();

            if (faultInFlow != null) {
                Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
            }

            Flow faultOutFlow = axismodule.getFaultOutFlow();

            if (faultOutFlow != null) {
                Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
            }
        } catch (AxisFault axisFault) {
View Full Code Here


     * @return Returns Flow.
     * @throws DeploymentException <code>DeploymentException</code>
     */
    protected Flow processFlow(OMElement flowelement, ParameterInclude parent)
            throws DeploymentException {
        Flow flow = new Flow();

        if (flowelement == null) {
            return flow;
        }

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

        while (handlers.hasNext()) {
            OMElement handlerElement = (OMElement) handlers.next();

            flow.addHandler(processHandler(handlerElement, parent));
        }

        return flow;
    }
View Full Code Here

    }

    public static void addNewModule(AxisModule modulemetadata,
                                    AxisConfiguration axisConfiguration) throws AxisFault {

        Flow inflow = modulemetadata.getInFlow();
        ClassLoader moduleClassLoader = modulemetadata.getModuleClassLoader();

        if (inflow != null) {
            Utils.addFlowHandlers(inflow, moduleClassLoader);
        }

        Flow outFlow = modulemetadata.getOutFlow();

        if (outFlow != null) {
            Utils.addFlowHandlers(outFlow, moduleClassLoader);
        }

        Flow faultInFlow = modulemetadata.getFaultInFlow();

        if (faultInFlow != null) {
            Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
        }

        Flow faultOutFlow = modulemetadata.getFaultOutFlow();

        if (faultOutFlow != null) {
            Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
        }
View Full Code Here

                    config.isChildFirstClassLoading());
            axismodule.setModuleClassLoader(currentDeploymentFile.getClassLoader());
            archiveReader.readModuleArchive(currentDeploymentFile, axismodule,
                    false, config);
            ClassLoader moduleClassLoader = axismodule.getModuleClassLoader();
            Flow inflow = axismodule.getInFlow();

            if (inflow != null) {
                Utils.addFlowHandlers(inflow, moduleClassLoader);
            }

            Flow outFlow = axismodule.getOutFlow();

            if (outFlow != null) {
                Utils.addFlowHandlers(outFlow, moduleClassLoader);
            }

            Flow faultInFlow = axismodule.getFaultInFlow();

            if (faultInFlow != null) {
                Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
            }

            Flow faultOutFlow = axismodule.getFaultOutFlow();

            if (faultOutFlow != null) {
                Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
            }
        } catch (AxisFault axisFault) {
View Full Code Here

    protected void setUp() throws Exception {
    }


    public void testFailureAtServerRequestFlow() throws Exception {
        Flow flow = new FlowImpl();
        Utils.addHandler(flow,
                new SpeakingHandler(),
                PhaseMetadata.PHASE_POLICY_DETERMINATION);
        Utils.addHandler(flow,
                new SpeakingHandler(),
View Full Code Here

     * @param flowelement       <code>OMElement</code>
     * @return
     * @throws DeploymentException  <code>DeploymentException</code>
     */
    protected Flow processFlow(OMElement flowelement, ParameterInclude parent) throws DeploymentException {
        Flow flow = new FlowImpl();
        if(flowelement == null){
            return flow;
        }
        Iterator handlers = flowelement.getChildrenWithName(
                new QName(HANDERST));
        while (handlers.hasNext()) {
            OMElement  handlerElement =  (OMElement)handlers.next();
            flow.addHandler(processHandler(handlerElement,parent));
        }
        return flow;
    }
View Full Code Here

     */
    private void buildExcutionChains(int type, OperationDescription operation)
            throws AxisFault, PhaseException {
        ArrayList allHandlers = new ArrayList();
        ModuleDescription module;
        Flow flow = null;
        ///////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////// Handlers from   axis2.xml from modules/////////////////////////
        ArrayList modulqnames = (ArrayList) ((AxisConfigurationImpl) axisConfig).getEngadgedModules();
        for (int i = 0; i < modulqnames.size(); i++) {
            QName modulename = (QName) modulqnames.get(i);
            module = axisConfig.getModule(modulename);
            if (module != null) {
                switch (type) {
                    case PhaseMetadata.IN_FLOW:
                    {
                        flow = module.getInFlow();
                        break;
                    }
                    case PhaseMetadata.OUT_FLOW:
                    {
                        flow = module.getOutFlow();
                        break;
                    }
                    case PhaseMetadata.FAULT_IN_FLOW:
                    {
                        flow = module.getFaultInFlow();
                        break;
                    }
                    case PhaseMetadata.FAULT_OUT_FLOW:
                    {
                        flow = module.getFaultOutFlow();
                        break;
                    }
                }
                axisService.addToEngagModuleList(module);
                operation.addToEngageModuleList(module);
            } else {
                throw new PhaseException(Messages.getMessage(
                        DeploymentErrorMsgs.INVALID_MODULE_REF, modulename.getLocalPart()));
            }

            if (flow != null) {
                for (int j = 0; j < flow.getHandlerCount(); j++) {
                    HandlerDescription metadata = flow.getHandler(j);

                    if (!PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
                        allHandlers.add(metadata);
                    } else {
                        /**
                         *This handler is trying to added to system pre defined phases , but those handlers
                         * are already added to global chain which run irrespective of the service
                         *
                         */
                    }
                }
            }

        }

        ///////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////// SERVICE HANDLERS ///////////////////////////////////////////////
        switch (type) {
            case PhaseMetadata.IN_FLOW:
            {
                flow = axisService.getInFlow();
                break;
            }
            case PhaseMetadata.OUT_FLOW:
            {
                flow = axisService.getOutFlow();
                break;
            }
            case PhaseMetadata.FAULT_IN_FLOW:
            {
                flow = axisService.getFaultInFlow();
                break;
            }
            case PhaseMetadata.FAULT_OUT_FLOW:
            {
                flow = axisService.getFaultOutFlow();
                break;
            }
        }
        if (flow != null) {
            for (int j = 0; j < flow.getHandlerCount(); j++) {
                HandlerDescription metadata = flow.getHandler(j);

                // todo change this in properway
                if (metadata.getRules().getPhaseName().equals("")) {
                    throw new PhaseException(
                            Messages.getMessage(DeploymentErrorMsgs.PHASE_DOES_NOT_SPECIFED,
View Full Code Here

    }


    private void buildINTransportChains(TransportInDescription transport)
            throws PhaseException {
        Flow flow = null;
        Phase phase = null;
        for (int type = 1; type < 4; type++) {
            switch (type) {
                case PhaseMetadata.IN_FLOW:
                {
                    flow = transport.getInFlow();
                    phase = transport.getInPhase();
                    break;
                }
                case PhaseMetadata.FAULT_IN_FLOW:
                {
                    flow = transport.getFaultFlow();
                    phase = transport.getFaultPhase();
                    break;
                }
            }
            if (flow != null) {
                ArrayList handlers = new ArrayList();
                for (int j = 0; j < flow.getHandlerCount(); j++) {
                    HandlerDescription metadata = flow.getHandler(j);
                    metadata.getRules().setPhaseName(PhaseMetadata.TRANSPORT_PHASE);
                    handlers.add(metadata);
                }
                new PhaseHolder().buildTransportHandlerChain(phase, handlers);
            } else {
View Full Code Here

     * @param transport
     * @throws PhaseException
     */
    private void buildOutTransportChains(TransportOutDescription transport)
            throws PhaseException {
        Flow flow = null;
        Phase phase = null;
        for (int type = 1; type < 5; type++) {
            switch (type) {
                case PhaseMetadata.OUT_FLOW:
                {
                    flow = transport.getOutFlow();
                    phase = transport.getOutPhase();
                    break;
                }
                case PhaseMetadata.FAULT_OUT_FLOW:
                {
                    flow = transport.getFaultFlow();
                    phase = transport.getFaultPhase();
                    break;
                }
            }
            if (flow != null) {
                ArrayList handlers = new ArrayList();
                for (int j = 0; j < flow.getHandlerCount(); j++) {
                    HandlerDescription metadata = flow.getHandler(j);
                    metadata.getRules().setPhaseName(PhaseMetadata.TRANSPORT_PHASE);
                    handlers.add(metadata);
                }
                new PhaseHolder().buildTransportHandlerChain(phase, handlers);
            } else {
View Full Code Here

                }
            }
            if (engaged) {
                continue;
            }
            Flow flow = null;
            for (int type = 1; type < 5; type++) {
                switch (type) {
                    case PhaseMetadata.IN_FLOW:
                    {
                        phaseHolder =
                                new PhaseHolder(opDesc.getRemainingPhasesInFlow());
                        break;
                    }
                    case PhaseMetadata.OUT_FLOW:
                    {
                        phaseHolder =
                                new PhaseHolder(opDesc.getPhasesOutFlow());
                        break;
                    }
                    case PhaseMetadata.FAULT_IN_FLOW:
                    {
                        phaseHolder =
                                new PhaseHolder(opDesc.getPhasesInFaultFlow());
                        break;
                    }
                    case PhaseMetadata.FAULT_OUT_FLOW:
                    {
                        phaseHolder =
                                new PhaseHolder(opDesc.getPhasesOutFaultFlow());
                        break;
                    }
                }
                ////////////////////////////////////////////////////////////////////////////////////
                /////////////////// Modules refered by axis2.xml //////////////////////////////////
                ////////////////////////////////////////////////////////////////////////////////////
                switch (type) {
                    case PhaseMetadata.IN_FLOW:
                    {
                        flow = module.getInFlow();
                        break;
                    }
                    case PhaseMetadata.OUT_FLOW:
                    {
                        flow = module.getOutFlow();
                        break;
                    }
                    case PhaseMetadata.FAULT_IN_FLOW:
                    {
                        flow = module.getFaultInFlow();
                        break;
                    }
                    case PhaseMetadata.FAULT_OUT_FLOW:
                    {
                        flow = module.getFaultOutFlow();
                        break;
                    }
                }
                if (flow != null) {
                    for (int j = 0; j < flow.getHandlerCount(); j++) {
                        HandlerDescription metadata = flow.getHandler(j);
                        if (!PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
                            phaseHolder.addHandler(metadata);
                        }
                    }
                }
View Full Code Here

TOP

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

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.