Package org.apache.axis2.description

Examples of org.apache.axis2.description.ModuleDescription


        try {
            HashMap modules = context.getAxisConfiguration().getModules();
            Collection col = modules.values();

            for (Iterator iterator = col.iterator(); iterator.hasNext();) {
                ModuleDescription axismodule = (ModuleDescription) iterator.next();
                Module module = axismodule.getModule();

                if (module != null) {
                    module.init(context.getAxisConfiguration());
                }
            }
View Full Code Here


     *
     * @param moduleref
     * @throws AxisFault
     */
    public void engageModule(QName moduleref) throws AxisFault {
        ModuleDescription module = getModule(moduleref);
        if (module == null) {
            // there is no module found with the given name , so better check for dafult module version
            String moduleName = moduleref.getLocalPart();
            String defaultModuleVersion = getDefaultModuleVersion(moduleName);
            if (defaultModuleVersion != null) {
View Full Code Here

     * @param versionID
     * @throws AxisFault
     */
    public void engageModule(String moduleName, String versionID) throws AxisFault {
        QName moduleQName = Utils.getModuleName(moduleName, versionID);
        ModuleDescription module = getModule(moduleQName);
        if (module == null) {
            module = loadModulefromResources(moduleQName.getLocalPart());
            engageModule(module, moduleQName);
        } else {
            engageModule(module, moduleQName);
View Full Code Here

     * @param moduleName
     * @return Returns ModuleDescription.
     * @throws AxisFault
     */
    public ModuleDescription loadModulefromResources(String moduleName) throws AxisFault {
        ModuleDescription module;
        // trying to read from resources
        File file = new ArchiveReader().creatModuleArchivefromResource(moduleName,
                getRepository());
        module = new DeploymentEngine().buildModule(file, this);
        if (module != null) {
View Full Code Here

     *
     * @param name
     * @return Returns ModuleDescription.
     */
    public ModuleDescription getModule(QName name) {
        ModuleDescription module = (ModuleDescription) allModules.get(name);
        if (module != null) {
            return module;
        }
        String moduelName = name.getLocalPart();
        // checking whether the version string seperator is not there in the module name
View Full Code Here

        // module from services.xml at serviceGroup level
        ArrayList groupModules = serviceGroup.getModuleRefs();

        for (int i = 0; i < groupModules.size(); i++) {
            QName moduleName = (QName) groupModules.get(i);
            ModuleDescription module = axisConfig.getModule(moduleName);

            if (module != null) {
                serviceGroup.engageModule(axisConfig.getModule(moduleName));
            } else {
                throw new DeploymentException(
                        Messages.getMessage(
                                DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE,
                                serviceGroup.getServiceGroupName(), moduleName.getLocalPart()));
            }
        }

        Iterator services = serviceList.iterator();

        while (services.hasNext()) {
            AxisService axisService = (AxisService) services.next();
            axisService.setUseDefaultChains(false);

            axisService.setFileName(currentArchiveFile.getFile().getAbsolutePath());
            serviceGroup.addService(axisService);

            // modules from <service>
            ArrayList list = axisService.getModules();

            for (int i = 0; i < list.size(); i++) {
                ModuleDescription module = axisConfig.getModule((QName) list.get(i));

                if (module == null) {
                    throw new DeploymentException(
                            Messages.getMessage(
                                    DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE, axisService.getName(),
                                    ((QName) list.get(i)).getLocalPart()));
                }

                axisService.engageModule(module, axisConfig);
            }

            HashMap operations = axisService.getOperations();
            Collection opCol = operations.values();

            for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
                AxisOperation opDesc = (AxisOperation) iterator.next();
                ArrayList modules = opDesc.getModuleRefs();

                for (int i = 0; i < modules.size(); i++) {
                    QName moduleName = (QName) modules.get(i);
                    ModuleDescription module = axisConfig.getModule(moduleName);

                    if (module != null) {
                        opDesc.engageModule(module, axisConfig);
                    } else {
                        throw new DeploymentException(
View Full Code Here

     * @return Returns ModuleDescription.
     * @throws DeploymentException
     */
    public ModuleDescription buildModule(File modulearchive, AxisConfiguration config)
            throws DeploymentException {
        ModuleDescription axismodule;

        try {
            this.setPhasesinfo(config.getPhasesInfo());
            currentArchiveFile = new ArchiveFileData(modulearchive, TYPE_MODULE);
            axismodule = new ModuleDescription();
            axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());

            ArchiveReader archiveReader = new ArchiveReader();
            ClassLoader moduleClassLoader = config.getModuleClassLoader();

            currentArchiveFile.setClassLoader(false, moduleClassLoader);
            archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule,
                    false, axisConfig);

            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);
            }

            //initilization Module
            Module module = axismodule.getModule();

            if (module != null) {
                module.init(axisConfig);
            }

View Full Code Here

                            archiveReader = new ArchiveReader();

                            String moduleStatus = "";

                            try {
                                ModuleDescription metaData = new ModuleDescription();

                                metaData.setModuleClassLoader(currentArchiveFile.getClassLoader());
                                metaData.setParent(axisConfig);
                                archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(),
                                        this, metaData, explodedDir,
                                        axisConfig);
                                addNewModule(metaData);
                                log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_MODULE,
                                        metaData.getName().getLocalPart()));
                            } catch (DeploymentException e) {
                                log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE,
                                        currentArchiveFile.getName(),
                                        e.getMessage()));
View Full Code Here

    public static void calculateDefaultModuleVersion(HashMap modules, AxisConfiguration axisConfig) {
        Iterator allModules = modules.values().iterator();
        HashMap defaultModules = new HashMap();
        while (allModules.hasNext()) {
            ModuleDescription moduleDescription = (ModuleDescription) allModules.next();
            QName moduleName = moduleDescription.getName();
            String moduleNameString = getModuleName(moduleName.getLocalPart());
            String moduleVersionString = getModuleVersion(moduleName.getLocalPart());
            String currentDefaultVerison = (String) defaultModules.get(moduleNameString);
            if (currentDefaultVerison != null) {
                if (isLatest(moduleVersionString, currentDefaultVerison)) {
View Full Code Here

        service.setInFlow(new MockFlow("service inflow", 4));
        service.setOutFlow(new MockFlow("service outflow", 5));
        //service.setFaultInFlow(new MockFlow("service faultflow", 1));

        ModuleDescription m1 = new ModuleDescription(
                new QName("", "A Mdoule 1"));
        m1.setInFlow(new MockFlow("service module inflow", 4));
        //m1.setFaultInFlow(new MockFlow("service module faultflow", 1));
        engineRegistry = new AxisConfigurationImpl();
        service.engageModule(m1,engineRegistry);

        OperationDescription operation = new OperationDescription(
View Full Code Here

TOP

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

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.