Examples of AxisModule


Examples of org.apache.axis2.description.AxisModule

        ConfigurationContext configContext =
                ConfigurationContextFactory .createConfigurationContextFromFileSystem(
                        "target/test-resources/integrationRepo",
                        "target/test-resources/integrationRepo/conf/axis2.xml");
        AxisModule axisModule = DeploymentEngine.buildModule(file,
                                                             configContext.getAxisConfiguration());
        configContext.getAxisConfiguration().addModule(axisModule);
        return configContext;
    }
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

        ConfigurationContext configContext = ConfigurationContextFactory
                .createConfigurationContextFromFileSystem(clientHome, null);
        AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();

        AxisModule axisModule = DeploymentEngine.buildModule(file,axisConfiguration);
        axisConfiguration.addModule(axisModule);

        axisConfiguration.addService(service);
        ServiceGroupContext serviceGroupContext =
                configContext.createServiceGroupContext((AxisServiceGroup) service.getParent());
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

        //get AxisService from service name
        AxisService service = this.retrieveAxisService(serviceName);

        // Retrieves caching module.
        AxisModule cachingModule = axisConfig.getModule(CachingComponentConstants.CACHING_MODULE);

        if (service.isEngaged(cachingModule)) {
            return true;
        }
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

    private void enableCaching(AxisDescription description, CachingConfigData confData,
                               String engagementPath)
            throws CachingComponentException, AxisFault {

        // Retrieves caching module.
        AxisModule cachingModule = axisConfig.getModule(CachingComponentConstants.CACHING_MODULE);

        try {
            configRegistry.beginTransaction();
            // Checks if an association exists between engagementPath and moduleResourcePath.
            Association[] associations = configRegistry.getAssociations(engagementPath,
View Full Code Here

Examples of org.apache.axis2.description.AxisModule


    public void globallyEngageCaching(CachingConfigData confData) throws AxisFault,
                                                                         CachingComponentException {
        // Retrieves caching module.
        AxisModule cachingModule = axisConfig.getModule(CachingComponentConstants.CACHING_MODULE);
        // Engage caching only if it is not engaged already.

        String resourcePath = getModuleResourcePath(cachingModule);

        try {
            configRegistry.beginTransaction();
            String globalPath = PersistenceUtils.getResourcePath(cachingModule);
            if (configRegistry.resourceExists(globalPath)) {
                Resource resource = configRegistry.get(globalPath);
                if (!Boolean.parseBoolean(resource
                        .getProperty(GLOBALLY_ENGAGED_CUSTOM))) {
                    resource.removeProperty(GLOBALLY_ENGAGED_CUSTOM);
                    resource.addProperty(GLOBALLY_ENGAGED_CUSTOM, "true");
                    configRegistry.put(globalPath, resource);
                }
            } else {
                Resource globalResource = configRegistry.newResource();
                globalResource.addProperty(GLOBALLY_ENGAGED_CUSTOM, "true");
                configRegistry.put(globalPath, globalResource);
            }

            // Gets a Policy object representing the configuration data.
            Policy policy = confData.toPolicy();

            // Add new policy to module
            this.handleNewPolicyAddition(policy, cachingModule.getPolicySubject(), confData);

            // Save the policy in the configRegistry.
            Resource policyResource = configRegistry.newResource();
            policyResource.setProperty(RegistryResources.ModuleProperties.POLICY_TYPE,
                                       "" + PolicyInclude.AXIS_MODULE_POLICY);
            policyResource.setProperty(RegistryResources.ModuleProperties.POLICY_UUID,
                                       policy.getId());
            policyResource.setProperty(RegistryResources.ModuleProperties.VERSION,
                                       cachingModule.getVersion().toString());
            cachingPolicyUtils.persistPoliciesToService(policy, resourcePath, null,
                                                        policyResource);
            if (log.isDebugEnabled()) {
                log.debug("Caching policy is saved in the configRegistry");
            }

            cachingModule.addParameter(new Parameter(GLOBALLY_ENGAGED_PARAM_NAME, "true"));

            //engage the module for every service which is not an admin service
            for (Iterator serviceIter = this.axisConfig.getServices().values().iterator();
                 serviceIter.hasNext();) {
                AxisService service = (AxisService) serviceIter.next();
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

        // Retrieves the AxisService instance corresponding to the serviceName.
        AxisService service = retrieveAxisService(serviceName);

        // Retrieves caching module.
        AxisModule cachingModule = axisConfig.getModule(CachingComponentConstants.CACHING_MODULE);

        if (service.isEngaged(cachingModule)) {
            return true;
        }
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

     */
    private void disableCaching(AxisDescription description, String engagementPath)
            throws CachingComponentException, AxisFault {
        // Removes caching from both the configRegistry and the description
        try {
            AxisModule cachingModule = axisConfig.getModule(CachingComponentConstants.CACHING_MODULE);

            configRegistry.beginTransaction();
            /* TODO - replace these two lines with moduleResourcePath += cachingModule.getVersion()
           This is done at the moment
            */
 
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

            log.debug("Disengaging globally engaged caching");
        }
        //disengage the caching module
        try {
            //get the caching module from the current axis config
            AxisModule module = this.axisConfig
                    .getModule(CachingComponentConstants.CACHING_MODULE);

            String resourcePath = getModuleResourcePath(module);
            configRegistry.beginTransaction();

            String globalPath = PersistenceUtils.getResourcePath(module);
            if (configRegistry.resourceExists(globalPath)) {
                Resource resource = configRegistry.get(globalPath);
                if (Boolean.parseBoolean(resource
                        .getProperty(GLOBALLY_ENGAGED_CUSTOM))) {
                    resource.removeProperty(GLOBALLY_ENGAGED_CUSTOM);
                    resource.addProperty(GLOBALLY_ENGAGED_CUSTOM, "false");
                    configRegistry.put(globalPath, resource);
                }
            }

            Parameter param = module.getParameter(GLOBALLY_ENGAGED_PARAM_NAME);
            if (param != null) {
                module.removeParameter(module.getParameter(GLOBALLY_ENGAGED_PARAM_NAME));
            }

            //disengage throttling from all the services which are not admin services
            for (Iterator serviceIter = this.axisConfig.getServices().values().iterator();
                 serviceIter.hasNext();) {
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

            throws CachingComponentException {
        // Retrieves the AxisService instance corresponding to the serviceName.
        AxisService service = retrieveAxisService(serviceName);
        AxisOperation operation = service.getOperation(new QName(operationName));

        AxisModule module = this.axisConfig.getModule(CachingComponentConstants.CACHING_MODULE);

        Policy[] arr = null;
        Collection policyComponents = null;

        if (service.isEngaged(module)) {
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

     *
     * @return CachingConfigData
     * @throws CachingComponentException - on error
     */
    public CachingConfigData getGlobalCachingPolicy() throws CachingComponentException {
        AxisModule module = this.axisConfig
                .getModule(CachingComponentConstants.CACHING_MODULE);

        Collection policyComponents = module.getPolicySubject().getAttachedPolicyComponents();
        return getCachingConfig(policyComponents);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.