Examples of AxisModule


Examples of org.apache.axis2.description.AxisModule

                    new URL[]{rampartURL},
                    axisConfiguration.getModuleClassLoader(),
                    true,
                    (File) axisConfiguration.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
           
            final AxisModule module = new AxisModule();
            module.setModuleClassLoader(deploymentClassLoader);
            module.setParent(axisConfiguration);

            if (module.getName() == null) {
                module.setName("rampart-1.4");
                module.setVersion(new Version("1.4"));
            }
           
            populateModule(axis2ConfigContext, module, rampartURL);
            module.setFileName(rampartURL);
           
            // Allow privileged access to read properties. Requires PropertiesPermission read in
            // security policy.
            try {
                AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

    public void configureModules(ConfigurationContext configurationContext) {
        for (Map.Entry<Bundle, List<URL>> entry : bundleModuleXmlURLsMap.entrySet()) {
            Bundle bundle = entry.getKey();
            for (URL url : entry.getValue()) {
                try {
                    AxisModule axismodule = new AxisModule();
                    ClassLoader loader = new org.apache.axis2.osgi.deployment.BundleClassLoader(bundle, Registry.class.getClassLoader());
                    axismodule.setModuleClassLoader(loader);
                    AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
                    ModuleBuilder builder = new ModuleBuilder(url.openStream(), axismodule, axisConfig);
                    Dictionary headers = bundle.getHeaders();
                    String bundleSymbolicName = (String) headers.get("Bundle-SymbolicName");
                    if (bundleSymbolicName != null && bundleSymbolicName.length() != 0) {
                        axismodule.setName(bundleSymbolicName);
                    }
                    String bundleVersion = (String) headers.get("Bundle-Version");
                    if (bundleVersion != null && bundleVersion.length() != 0) {
                        /*
                            Bundle version is defined as
                            version ::=
                                major( '.' minor ( '.' micro ( '.' qualifier )? )? )?
                                major ::= number
                                minor ::= number
                                micro ::= number
                                qualifier ::= ( alphanum | ’_’ | '-' )+
                         */
                        String[] versionSplit = bundleVersion.split("\\.");
                        int[] components = new int[Math.min(versionSplit.length, 3)];
                        for (int i = 0; i < components.length; i++) {
                            components[i] = Integer.parseInt(versionSplit[i]);
                        }
                        axismodule.setVersion(new Version(components, versionSplit.length > 3 ? versionSplit[3] : null));
                    }
                    builder.populateModule();
                    axismodule.setParent(axisConfig);
                    AxisModule module = axisConfig.getModule(axismodule.getName());
                    if (module == null) {
                        DeploymentEngine.addNewModule(axismodule, axisConfig);
                        //initialze the module if the module contains Module interface.
                        Module moduleObj = axismodule.getModule();
                        if (moduleObj != null) {
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

            //checking weather the module is engaged at the System level
            AxisConfiguration axisConfiguration = messageContext.getConfigurationContext().getAxisConfiguration();
            if (axisConfiguration!=null) {
              Collection modules = axisConfiguration.getEngagedModules();
              for (Iterator iter = modules.iterator();iter.hasNext();) {
                AxisModule module = (AxisModule) iter.next();
                String moduleName = module.getName();
                if (moduleName!=null && moduleName.startsWith (Sandesha2Constants.MODULE_NAME)) {
                  engaged = true;
                }
              }
            }
           
            //checking weather the module is engaged at the Service level
            AxisService service = messageContext.getAxisService();
            if (service!=null) {
              Collection modules = service.getEngagedModules();
              for (Iterator iter = modules.iterator();iter.hasNext();) {
                AxisModule module = (AxisModule) iter.next();
                String name = module.getName();
                if (name!=null && name.startsWith (Sandesha2Constants.MODULE_NAME)) {
                  engaged = true;
                }
              }
            }

            //checking weather the module is engaged at the Operation level
            AxisOperation operation = messageContext.getAxisOperation();
            if (operation!=null) {
              Collection modules = operation.getEngagedModules();
              for (Iterator iter = modules.iterator();iter.hasNext();) {
                AxisModule module = (AxisModule) iter.next();
                String name = module.getName();
                if (name!=null && name.startsWith (Sandesha2Constants.MODULE_NAME)) {
                  engaged = true;
                }
              }
            }
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

     * @param moduleName name of the module to engage
     * @throws AxisFault if something goes wrong
     */
    public void engageModule(String moduleName) throws AxisFault {
        synchronized (this.axisConfig) {
            AxisModule module = axisConfig.getModule(moduleName);
            if (module != null) {
                axisService.engageModule(module);
            } else {
                throw new AxisFault("Unable to engage module : " + moduleName);
            }
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

     *
     * @param moduleName name of Module to disengage
     */
    public void disengageModule(String moduleName) {
        synchronized (this.axisConfig) {
            AxisModule module = axisConfig.getModule(moduleName);
            if (module != null) {
                try {
                    axisService.disengageModule(module);
                } catch (AxisFault axisFault) {
                    log.error(axisFault.getMessage(), axisFault);
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

     *
     * @param moduleref name of module to engage
     * @throws AxisFault
     */
    public void engageModule(String moduleref) throws AxisFault {
        AxisModule module = getModule(moduleref);
        if (module != null) {
            engageModule(module);
        } else {
            throw new AxisFault(Messages.getMessage("modulenotavailble", moduleref));
        }
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

     * @throws AxisFault
     */
    public void engageModule(String moduleName, String versionID)
            throws AxisFault {
        String actualName = Utils.getModuleName(moduleName, versionID);
        AxisModule module = getModule(actualName);
        if (module != null) {
            engageModule(module);
        } else {
            // TODO : Should this be an NPE or InvalidArgumentException?
            throw new AxisFault(Messages.getMessage("refertoinvalidmodule"));
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

     *
     * @param name module name to look up
     * @return an AxisModule if found, or null
     */
    public AxisModule getModule(String name) {
        AxisModule module = allModules.get(name);
        if (module != null) {
            return module;
        }
        // checks whether the version string seperator is not there in the
        // module name
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

    public HashMap<String, TransportOutDescription> getTransportsOut() {
        return transportsOut;
    }
   
    public boolean isEngaged(String moduleId) {
        AxisModule module = getModule(moduleId);
        if (module == null) {
            return false;
        }
        boolean isEngaged = super.isEngaged(module);
        if (!isEngaged) {
            AxisModule defaultModule = getDefaultModule(moduleId);
            isEngaged = engagedModules != null && engagedModules.values().contains(defaultModule);
        }
        return isEngaged;
    }
View Full Code Here

Examples of org.apache.axis2.description.AxisModule

                    org.apache.axis2.deployment.util.Utils.createClassLoader(
                            new URL[]{rampart_mar_url},
                            axisConfig.getModuleClassLoader(),
                            true,
                            (File) axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
            final AxisModule module = new AxisModule();
            module.setModuleClassLoader(deploymentClassLoader);
            module.setParent(axisConfig);
            //String moduleFile = fileUrl.substring(0, fileUrl.indexOf(".mar"));
            if (module.getName() == null) {
                module.setName("rampart");
                module.setVersion("1.4");
            }
            populateModule(module, rampart_mar_url);
            module.setFileName(rampart_mar_url);
            // Allow privileged access to read properties. Requires PropertiesPermission read in
            // security policy.
            try {
                AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                    public Object run() throws IOException {
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.