Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.AxisConfiguration


                org.apache.axis2.context.MessageContext axis2MessageContext =
                    messageContext.getAxisMessageContext();
                axis2MessageContext.setTo(epr);
               
                ServiceDescription sd = messageContext.getEndpointDescription().getServiceDescription();
                AxisConfiguration axisConfig = sd.getAxisConfigContext().getAxisConfiguration();
                if (!axisConfig.isEngaged(Constants.MODULE_ADDRESSING)) {
                    axisConfig.engageModule(Constants.MODULE_ADDRESSING);
                }
            }
            catch (Exception e) {
                throw ExceptionFactory.
                    makeWebServiceException(
View Full Code Here


   * @throws SandeshaException
   */
  private static boolean validateMessage(RMMsgContext rmMsgCtx) throws SandeshaException {

    ConfigurationContext configContext = rmMsgCtx.getMessageContext().getConfigurationContext();
    AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext, axisConfiguration);
    SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();

    String sequenceID = null;

View Full Code Here

        return is;
    }

    private void debugMemoryParms(ConfigurationContext configContext) {
        if (configContext != null) {
            AxisConfiguration axisCfg = configContext.getAxisConfiguration();

            boolean reduceWSDLMemoryCache = false;
            int reduceWSDLMemoryType = 9;
            // determine what the setting for the memory optimization is
            if (axisCfg != null) {
                Parameter param = axisCfg.getParameter(Constants.Configuration.REDUCE_WSDL_MEMORY_CACHE);

                reduceWSDLMemoryCache =
                    param != null && ((String) param.getValue()).equalsIgnoreCase("true");


                param = axisCfg.getParameter(Constants.Configuration.REDUCE_WSDL_MEMORY_TYPE);

                if (param != null) {
                    String value = (String) param.getValue();

                    if (value != null) {
View Full Code Here

  public static MessageContext createNewRelatedMessageContext(RMMsgContext referenceRMMessage, AxisOperation operation)
      throws SandeshaException {
    try {
      MessageContext referenceMessage = referenceRMMessage.getMessageContext();
      ConfigurationContext configContext = referenceMessage.getConfigurationContext();
      AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();

      MessageContext newMessageContext = new MessageContext();
      newMessageContext.setConfigurationContext(configContext);
     
      Options newOptions = new Options ();
View Full Code Here

  // TODO complete below.
  public static ArrayList getExecutionChainFromString(String executionChainStr, ConfigurationContext configContext)
      throws SandeshaException {
    String[] nameStrs = executionChainStr.split(Sandesha2Constants.EXECUTIN_CHAIN_SEPERATOR);

    AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();

    int length = nameStrs.length;
    for (int i = 0; i < length; i++) {
      String nameStr = nameStrs[i];
      // axisConfiguration.get
View Full Code Here

        service.addParameter(required);
           
            String value = Utils.getParameterValue(disabled);
        if (JavaUtils.isFalseExplicitly(value)) {
          ServiceDescription sd = endpointDescription.getServiceDescription();
          AxisConfiguration axisConfig = sd.getAxisConfigContext().getAxisConfiguration();
          if (!axisConfig.isEngaged(Constants.MODULE_ADDRESSING))
            axisConfig.engageModule(Constants.MODULE_ADDRESSING);
        }
      }
      catch (Exception e) {
            throw ExceptionFactory.makeWebServiceException(
                    Messages.getMessage("AddressingEngagementError", e.toString()));
View Full Code Here

        if (wsAddressingEnabled) {
            axisOutMsgCtx.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE);
        }

        ConfigurationContext axisCfgCtx = axisOutMsgCtx.getConfigurationContext();
        AxisConfiguration axisCfg       = axisCfgCtx.getAxisConfiguration();

        AxisService anoymousService =
            AnonymousServiceFactory.getAnonymousService(
            axisCfg, wsAddressingEnabled, wsRMEnabled, wsSecurityEnabled);
        ServiceGroupContext sgc = new ServiceGroupContext(
View Full Code Here

            log.warn("Unable to report hostname or IP address for tracing", e);
        }

        log.info("Deploying the Synapse service..");
        // Dynamically initialize the Synapse Service and deploy it into Axis2
        AxisConfiguration axisCfg = configurationContext.getAxisConfiguration();
        AxisService synapseService = new AxisService(SYNAPSE_SERVICE_NAME);
        AxisOperation mediateOperation = new InOutAxisOperation(MEDIATE_OPERATION_Q_NAME);
        mediateOperation.setMessageReceiver(new SynapseMessageReceiver());
        synapseService.addOperation(mediateOperation);
        axisCfg.addService(synapseService);

        // Initializing the SynapseEnvironment and SynapseConfiguration
        log.info("Initializing the Synapse configuration ...");
        SynapseConfiguration synCfg = initializeSynapse(configurationContext);
View Full Code Here

    }

    private static SynapseConfiguration initializeSynapse(
        ConfigurationContext cfgCtx) {

        AxisConfiguration axisConfiguration = cfgCtx.getAxisConfiguration();

        /*
        First check, if synapse.xml URL is provided as a system property, if so use it..
        else check if synapse.xml location is available from the axis2.xml
        "SynapseConfiguration" else use the default config
        */
        SynapseConfiguration synapseConfiguration;
        Parameter configParam = axisConfiguration.getParameter(Constants.SYNAPSE_CONFIGURATION);

        String config = System.getProperty(Constants.SYNAPSE_XML);

        if (config != null) {
            log.info("System property '" + Constants.SYNAPSE_XML +
                "' specifies synapse configuration as " + config);
            synapseConfiguration =
                SynapseConfigurationBuilder.getConfiguration(config);
        } else if (configParam != null) {
            log.info(
                "Synapse configuration is available via the " +
                    "'SynapseConfiguration' parameter in axis2.xml");
            synapseConfiguration = SynapseConfigurationBuilder
                .getConfiguration(configParam.getValue().toString().trim());
        } else {
            log.warn("System property '" + Constants.SYNAPSE_XML +
                "' is not specified or 'SynapseConfiguration' Parameter " +
                "is not available via axis2.xml.  Using default configuration..");
            synapseConfiguration =
                SynapseConfigurationBuilder.getDefaultConfiguration();
        }

        // Set the Axis2 ConfigurationContext to the SynapseConfiguration
        synapseConfiguration.setAxisConfiguration(cfgCtx.getAxisConfiguration());

        // set the Synapse configuration and environment into the Axis2 configuration
        Parameter synapseCtxParam = new Parameter(Constants.SYNAPSE_CONFIG, null);
        synapseCtxParam.setValue(synapseConfiguration);

        Parameter synapseEnvParam = new Parameter(Constants.SYNAPSE_ENV, null);

        Parameter synEnvImpl = axisConfiguration.getParameter(Constants.SYNAPSE_ENV_IMPL);
        if (synEnvImpl != null && synEnvImpl.getValue() != null) {
            String clazz = (String) synEnvImpl.getValue();
            try {
                Constructor constr = Class.forName(clazz).getDeclaredConstructor(
                    new Class[]{ConfigurationContext.class});
                synapseEnvParam.setValue(constr.newInstance(new Object[]{cfgCtx}));
            } catch (ClassNotFoundException e) {
                handleException("Cannot find Synapse environment implementation : " + clazz, e);
            } catch (NoSuchMethodException e) {
                handleException("Cannot find Synapse environment constructor : " + clazz, e);
            } catch (IllegalAccessException e) {
                handleException("Error instantiating Synapse environment with : " + clazz, e);
            } catch (InvocationTargetException e) {
                handleException("Error invoking constructor of Synapse environment : " + clazz, e);
            } catch (InstantiationException e) {
                handleException("Error instantiating Synapse environment with : " + clazz, e);
            }
        } else {
            synapseEnvParam.setValue(new Axis2SynapseEnvironment(cfgCtx, synapseConfiguration));
        }

        try {
            axisConfiguration.addParameter(synapseCtxParam);
            axisConfiguration.addParameter(synapseEnvParam);

        } catch (AxisFault e) {
            String msg =
                "Could not set parameters '" + Constants.SYNAPSE_CONFIG +
                    "' and/or '" + Constants.SYNAPSE_ENV +
View Full Code Here

            log.debug("RM Mediator works only for the First Chain");
            return true;
        }

        ConfigurationContext cc = msgCtx.getConfigurationContext();
        AxisConfiguration ac = cc.getAxisConfiguration();

        try {
            rmEnabledService(cc, ac, msgCtx);

            AxisEngine ae = new AxisEngine(cc);
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.AxisConfiguration

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.