Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisModule


   * @param path    The path to .mar-file holding the modules classes.
   */
  private void loadModule(String name, String version, String path )
    throws DeploymentException
  {
    AxisModule module = new AxisModule();
    module.setModuleClassLoader(this.getClass().getClassLoader());
    module.setParent(axisConfig);
    URL moduleurl = this.getClass().getResource(path);
    module.setName(name);
    module.setVersion(version);
    axisConfig.addDefaultModuleVersion(module.getName(),module.getVersion());

    populateModule(module, moduleurl);
    module.setFileName(moduleurl);
    try {
      DeploymentEngine.addNewModule(module, axisConfig);
    } catch (AxisFault e) {
      throw new DeploymentException(e);
    }
View Full Code Here


    private void engageModules() throws AxisFault {
        if ( wsBinding instanceof PolicySetAttachPoint ) {
            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
            if ( policiedBinding.getPolicySets().size() > 0 ) {
                //TODO: need to verify if one of the policies are concerned with security
                AxisModule m = new AxisModule("rampart");
                m.setFileName(wsBinding.getClass().getClassLoader().getResource("rampart-1.2.mar"));
                configContext.getAxisConfiguration().addModule(m);
                configContext.getAxisConfiguration().engageModule(m, configContext.getAxisConfiguration());
            }
        }
    }
View Full Code Here

                return Thread.currentThread().getContextClassLoader();
            }
        });


        AxisModule module = new AxisModule();
        module.setParent(configContext.getAxisConfiguration());
    String moduleName = "rampart-1.2";
    URL moduleurl = TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/rampart-1.2.mar");
    module.setName(moduleName);
    ClassLoader deploymentClassloader = Utils.createClassLoader(new URL[]{moduleurl},
                          tccl,
                          true,
                          (File)configContext.getAxisConfiguration().getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                         
    module.setModuleClassLoader(deploymentClassloader);
    populateModule(module, moduleurl,configContext.getAxisConfiguration());
    module.setFileName(moduleurl);
    TuscanyAxisConfigurator.addNewModule(module, configContext.getAxisConfiguration());
    org.apache.axis2.util.Utils.calculateDefaultModuleVersion(
        configContext.getAxisConfiguration().getModules(), configContext.getAxisConfiguration());
    }
View Full Code Here

            //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

      //copyint properties as configured in the module.xml properties. Module xml has several
      //properties which gives comma seperated lists of property names that have to be copited
      //from various places when creating related messages.
     
      AxisModule axisModule = SandeshaUtil.getAxisModule();

      Parameter propertiesFromRefMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceMessage);
      if (propertiesFromRefMsg!=null) {
        String value = (String) propertiesFromRefMsg.getValue();
        if (value!=null) {
          value = value.trim();
          String[] propertyNames = value.split(",");
          for (int i=0;i<propertyNames.length;i++) {
            String propertyName = propertyNames[i];
            Object val = referenceMessage.getProperty(propertyName);
            if (val!=null) {
              newMessageContext.setProperty(propertyName,val);
            }
          }
        }
      }
     
      Parameter propertiesFromRefReqMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessage);
      OperationContext referenceOpCtx = referenceMessage.getOperationContext();
      MessageContext referenceRequestMessage = null;
      if (referenceOpCtx!=null)
        referenceRequestMessage=referenceOpCtx.getMessageContext(OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
     
View Full Code Here

                emptyOperation.setMessageReceiver(new EmptyRMMessageReceiver());
                emptyRMEngagedService.addOperation(emptyOperation);
                ac.addService(emptyRMEngagedService);

                as = emptyRMEngagedService;
                AxisModule am = ac
                        .getModule(Constants.SANDESHA2_MODULE_NAME);

                if (am == null) {
                    throw new AxisFault("Sandesha 2 Module couldn't Find");
                }
View Full Code Here

    private void engageModules() throws AxisFault {
        if ( wsBinding instanceof PolicySetAttachPoint ) {
            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
            if ( policiedBinding.getPolicySets().size() > 0 ) {
                //TODO: need to verify if one of the policies are concerned with security
                AxisModule m = new AxisModule("rampart");
                m.setFileName(wsBinding.getClass().getClassLoader().getResource("rampart-1.2.mar"));
                configContext.getAxisConfiguration().addModule(m);
                configContext.getAxisConfiguration().engageModule(m, configContext.getAxisConfiguration());
            }
        }
    }
View Full Code Here

                return Thread.currentThread().getContextClassLoader();
            }
        });


        AxisModule module = new AxisModule();
        module.setParent(configContext.getAxisConfiguration());
    String moduleName = "rampart-1.2";
    URL moduleurl = TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/rampart-1.2.mar");
    module.setName(moduleName);
    ClassLoader deploymentClassloader = Utils.createClassLoader(new URL[]{moduleurl},
                          tccl,
                          true,
                          (File)configContext.getAxisConfiguration().getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                         
    module.setModuleClassLoader(deploymentClassloader);
    populateModule(module, moduleurl,configContext.getAxisConfiguration());
    module.setFileName(moduleurl);
    TuscanyAxisConfigurator.addNewModule(module, configContext.getAxisConfiguration());
    org.apache.axis2.util.Utils.calculateDefaultModuleVersion(
        configContext.getAxisConfiguration().getModules(), configContext.getAxisConfiguration());
    }
View Full Code Here

                emptyOperation.setMessageReceiver(new EmptyRMMessageReceiver());
                emptyRMEngagedService.addOperation(emptyOperation);
                ac.addService(emptyRMEngagedService);

                as = emptyRMEngagedService;
                AxisModule am = ac
                        .getModule(Constants.SANDESHA2_MODULE_NAME);

                if (am == null) {
                    throw new AxisFault("Sandesha 2 Module couldn't Find");
                }
View Full Code Here

                    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

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.