Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisModule


        String moduleResourcePath = RegistryResources.MODULES + moduleName + "/" + version;
        getConfigSystemRegistry().addAssociation(RegistryResources.Associations.ENGAGED_MODULES,
                                                 serviceResourcePath, moduleResourcePath);

        // engage at axis2
        AxisModule module = axisService.getAxisConfiguration().getModule(moduleName);
        axisService.disengageModule(module);
        axisService.engageModule(module);

    }
View Full Code Here


     * @throws AxisFault on error
     */
    public String getModulePolicy(String moduleName, String moduleVersion) throws AxisFault {
        AxisConfiguration axisConfig = MessageContext.getCurrentMessageContext()
                .getConfigurationContext().getAxisConfiguration();
        AxisModule axisModule = axisConfig.getModule(moduleName, moduleVersion);

        if (axisModule == null) {
            throw new AxisFault("invalid service name");
        }

        PolicySubject modulePolicySubject = axisModule.getPolicySubject();
        List<PolicyComponent> policyList =
                new ArrayList<PolicyComponent>(modulePolicySubject.getAttachedPolicyComponents());

        // Get the merged module policy
        Policy policy = null;
View Full Code Here

        }

        // At axis2
        AxisConfiguration axisConfig = MessageContext.getCurrentMessageContext()
                .getConfigurationContext().getAxisConfiguration();
        AxisModule axisModule = axisConfig.getModule(moduleName, moduleVersion);
        axisModule.getPolicySubject().clear();
        axisModule.getPolicySubject().attachPolicy(policy);

        // At Registry
        Resource policyResource = getConfigSystemRegistry().newResource();
        policyResource.setProperty(RegistryResources.ModuleProperties.POLICY_UUID, policy.getId());
        policyResource.setProperty(RegistryResources.ModuleProperties.VERSION, moduleVersion);
View Full Code Here

                Collection axisServiceLevelEngagedModuleCollection = axisService
                        .getEngagedModules();
                List aoOnlyModuleList = new ArrayList();
                for (Iterator iterator1 = operationLevelEngagedModulesCollection.iterator(); iterator1
                        .hasNext();) {
                    AxisModule axisModule = (AxisModule) iterator1.next();
                    if (axisServiceLevelEngagedModuleCollection.contains(axisModule)) {
                        continue;
                    }
                    aoOnlyModuleList.add(axisModule);
                }
                serializeModules(aoOnlyModuleList, operationEle, fac, ns, operation);

                Map axisMessagesMap = new AxisMessageLookup().lookup(operation);
                Set axisMessagesSet = axisMessagesMap.entrySet();
                for (Iterator iterator1 = axisMessagesSet.iterator(); iterator1.hasNext();) {
                    Map.Entry me = (Map.Entry) iterator1.next();
                    String lableKey = (String) me.getKey();
                    AxisMessage axisMessage = (AxisMessage) me.getValue();
                    OMElement axisMessageEle = createOMElement(fac, ns,
                                                               DeploymentConstants.TAG_MESSAGE);
                    OMAttribute axisMessageLableAttr = createOMAttribute(fac, ns,
                                                                         DeploymentConstants.TAG_LABEL, lableKey);
                    axisMessageEle.addAttribute(axisMessageLableAttr);

                    List axisMessageParameterList = axisMessage.getParameters();
                    serializeParameterList(axisMessageParameterList, axisMessageEle, fac, ns);

                    PolicyInclude policyInclude = operation.getPolicyInclude();
                    PolicyRegistry registry = policyInclude.getPolicyRegistry();
                    List policyList = policyInclude
                            .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
                    if (!policyList.isEmpty()) {
                        serializePolicyIncludes(axisMessageEle, policyList, registry);
                    }

                }

                PolicyInclude policyInclude = operation.getPolicyInclude();
                PolicyRegistry registry = policyInclude.getPolicyRegistry();
                List policyList = policyInclude
                        .getPolicyElements(PolicyInclude.AXIS_OPERATION_POLICY);
                if (!policyList.isEmpty()) {
                    serializePolicyIncludes(operationEle, policyList, registry);
                }
            }

        }

        List serviceParameterList = axisService.getParameters();
        serializeParameterList(serviceParameterList, serviceEle, fac, ns);

        //service level engaged modules.
        Collection serviceEngagedModuleCollection = axisService.getEngagedModules();
        AxisDescription parent = axisService.getParent();
        AxisServiceGroup asg = (AxisServiceGroup) parent;
        Collection asgEngagedModulesCollection = asg.getEngagedModules();
        List asOnlyModuleList = new ArrayList();
        for (Iterator iterator = serviceEngagedModuleCollection.iterator(); iterator.hasNext();) {
            AxisModule axisModule = (AxisModule) iterator.next();
            if (asgEngagedModulesCollection.contains(axisModule.getName())) {
                continue;
            }
            asOnlyModuleList.add(axisModule);
        }
View Full Code Here

                                           OMFactory fac, OMNamespace ns,
                                           AxisDescription axisDesc) {
        if (moduleCollection != null) {

            for (Iterator iterator = moduleCollection.iterator(); iterator.hasNext();) {
                AxisModule axisModule = (AxisModule) iterator.next();
                String moduleName = axisModule.getName();
                if (SystemFilter.isFilteredOutModule(moduleName)
                    || axisDesc.getParent().isEngaged(axisModule)) {
                    continue;
                }
View Full Code Here

    private static final Log log = LogFactory.getLog(ServiceStatisticsAxis2ConfigurationContextObserver.class);

    public void createdConfigurationContext(ConfigurationContext configContext) {

        AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
        AxisModule serviceStatisticsModule = axisConfiguration
            .getModule(ServiceStatisticsPublisherConstants.BAM_SERVICE_STATISTISTICS_PUBLISHER_MODULE_NAME);
        int tenantId = SuperTenantCarbonContext.getCurrentContext(axisConfiguration).getTenantId();
        if (serviceStatisticsModule != null) {
            try {
                axisConfiguration
View Full Code Here

                                    new URL[]{moduleurl},
                                    axisConfig.getModuleClassLoader(),
                                    true,
                                    (File) axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
                                    axisConfig.isChildFirstClassLoading());
                    AxisModule module = new AxisModule();
                    module.setModuleClassLoader(deploymentClassLoader);
                    module.setParent(axisConfig);
                    String moduleFile = fileUrl.substring(0, fileUrl.indexOf(".mar"));
                    module.setArchiveName(moduleFile);
                    populateModule(module, moduleurl);
                    module.setFileName(moduleurl);
                    addNewModule(module, axisConfig);
                    log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_MODULE,
                            module.getArchiveName(),
                            moduleurl.toString()));
                }
            }
            org.apache.axis2.util.Utils.
                    calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig);
View Full Code Here

        synchronized (axisConfig.getFaultyServicesDuetoModules()) {
            String moduleName;
            ArrayList groupModules = serviceGroup.getModuleRefs();
            for (Object groupModule : groupModules) {
                moduleName = (String) groupModule;
                AxisModule module = axisConfig.getModule(moduleName);

                if (module == null) {
                    axisConfig.addFaultyServiceDuetoModule(moduleName,
                            new FaultyServiceData(serviceGroup,
                                    serviceList,
                                    serviceLocation,
                                    currentDeploymentFile));
                    if (log.isDebugEnabled()) {
                        log.debug("Service: " + serviceGroup.getServiceGroupName() +
                                " becomes faulty due to Module: " + moduleName);
                    }
                    return false;
                }
            }

            for (Object aServiceList : serviceList) {
                AxisService axisService = (AxisService) aServiceList;

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

                for (Object aList : list) {
                    moduleName = (String) aList;
                    AxisModule module = axisConfig.getModule(moduleName);

                    if (module == null) {
                        axisConfig.addFaultyServiceDuetoModule(moduleName,
                                new FaultyServiceData(serviceGroup,
                                        serviceList,
                                        serviceLocation,
                                        currentDeploymentFile));
                        if (log.isDebugEnabled()) {
                            log.debug("Service: " + serviceGroup.getServiceGroupName() +
                                    " becomes faulty due to Module: " + moduleName);
                        }
                        return false;
                    }
                }

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

                    for (Object module1 : modules) {
                        moduleName = (String) module1;
                        AxisModule module = axisConfig.getModule(moduleName);

                        if (module == null) {
                            axisConfig.addFaultyServiceDuetoModule(moduleName,
                                    new FaultyServiceData(
                                            serviceGroup,
View Full Code Here

        // module from services.xml at serviceGroup level
        ArrayList groupModules = serviceGroup.getModuleRefs();
        serviceGroup.setParent(axisConfig);
        for (Object groupModule : groupModules) {
            String moduleName = (String) groupModule;
            AxisModule 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));
            }
        }

        Iterator services = serviceList.iterator();

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

            axisService.setFileName(serviceLocation);
            serviceGroup.addService(axisService);

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

            for (Object aList : list) {
                AxisModule module = axisConfig.getModule((String) aList);

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

                axisService.engageModule(module);
            }

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

                for (Object module1 : modules) {
                    String moduleName = (String) module1;
                    AxisModule module = axisConfig.getModule(moduleName);

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

     *          if there's a problem
     */
    public static AxisModule buildModule(File modulearchive,
                                         AxisConfiguration config)
            throws DeploymentException {
        AxisModule axismodule;
        ModuleDeployer deployer = (ModuleDeployer) config.getParameterValue(MODULE_DEPLOYER);
        try {
            if (deployer == null) {
                deployer = new ModuleDeployer(config);
                config.addParameter(MODULE_DEPLOYER, deployer);
            }

            DeploymentFileData currentDeploymentFile = new DeploymentFileData(modulearchive,
                    deployer);
            axismodule = new AxisModule();
            ArchiveReader archiveReader = new ArchiveReader();

            currentDeploymentFile.setClassLoader(false, config.getModuleClassLoader(), null,
                    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

TOP

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

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.