org.apache.axis2.description.Parameter.setValue()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中org.apache.axis2.description.Parameter.setValue()方法的一些代码示例,展示了Parameter.setValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parameter.setValue()方法的具体详情如下:
包路径:org.apache.axis2.description.Parameter
类名称:Parameter
方法名:setValue

Parameter.setValue介绍

[英]Method setValue.
[中]方法setValue。

代码示例

代码示例来源:origin: apache/axis2-java

/**
 * Generate a parametes object
 *
 * @param key
 * @param value
 */
private Parameter getParameter(String key, Object value) {
  Parameter myParameter = new Parameter();
  myParameter.setName(key);
  myParameter.setValue(value);
  return myParameter;
}

代码示例来源:origin: apache/axis2-java

/**
 * Generate a parametes object
 *
 * @param key
 * @param value
 */
private Parameter getParameter(String key, Object value) {
  Parameter myParameter = new Parameter();
  myParameter.setName(key);
  myParameter.setValue(value);
  return myParameter;
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt

public static Parameter getClientUsernameTokenHandler(String password) {
    Parameter param = new Parameter();
    param.setName(WSHandlerConstants.PW_CALLBACK_REF);
    param.setValue(new ClientUserPasswordCallbackHandler(password));
    return param;
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt

public static Parameter getClientUsernameTokenHandler(String password) {
    Parameter param = new Parameter();
    param.setName(WSHandlerConstants.PW_CALLBACK_REF);
    param.setValue(new ClientUserPasswordCallbackHandler(password));
    return param;
  }
}

代码示例来源:origin: wso2/carbon-identity-framework

public static Parameter getClientUsernameTokenHandler(String password) {
    Parameter param = new Parameter();
    param.setName(WSHandlerConstants.PW_CALLBACK_REF);
    param.setValue(new ClientUserPasswordCallbackHandler(password));
    return param;
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt

public static Parameter getTokenCancelerConfigParameter() {

    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMElement paramElem = fac.createOMElement(new QName("parameter"), null);
    paramElem.addAttribute(fac.createOMAttribute("name",
        null,
        TokenCancelerConfig.TOKEN_CANCELER_CONFIG.
            getLocalPart()));
    paramElem.addAttribute(fac.createOMAttribute("type",
        null, Integer.toString(Parameter.OM_PARAMETER).
            toString()));

    fac.createOMElement(TokenCancelerConfig.TOKEN_CANCELER_CONFIG,
        paramElem);
    Parameter param = new Parameter();
    param.setName(TokenCancelerConfig.TOKEN_CANCELER_CONFIG.getLocalPart());
    param.setParameterElement(paramElem);
    param.setValue(paramElem);
    param.setParameterType(Parameter.OM_PARAMETER);
    return param;
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt

protected void disableRESTCalls(String serviceName, String scenrioId)
    throws SecurityConfigException {
  if (scenrioId.equals(SecurityConstants.USERNAME_TOKEN_SCENARIO_ID)) {
    return;
  }
  try {
    AxisService service = axisConfig.getServiceForActivation(serviceName);
    if (service == null) {
      throw new SecurityConfigException("nullService");
    }
    Parameter param = new Parameter();
    param.setName(DISABLE_REST);
    param.setValue(Boolean.TRUE.toString());
    service.addParameter(param);
  } catch (AxisFault e) {
    log.error(e);
    throw new SecurityConfigException("disablingREST", e);
  }
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt

protected void disableRESTCalls(String serviceName, String scenrioId)
    throws SecurityConfigException {
  if (scenrioId.equals(SecurityConstants.USERNAME_TOKEN_SCENARIO_ID)) {
    return;
  }
  try {
    AxisService service = axisConfig.getServiceForActivation(serviceName);
    if (service == null) {
      throw new SecurityConfigException("nullService");
    }
    Parameter param = new Parameter();
    param.setName(DISABLE_REST);
    param.setValue(Boolean.TRUE.toString());
    service.addParameter(param);
  } catch (AxisFault e) {
    log.error(e);
    throw new SecurityConfigException("disablingREST", e);
  }
}

代码示例来源:origin: org.apache.axis2/axis2-metadata

/**
 * Return a Parameter instance for ServiceRefName if that name was specified on the sparse composite when the Service was created.
 * @param sparseCompositeKey identifies the instance of the service (i.e. Service Delegate)
 * @return A Parameter containing the ServiceRefName or null if one was not specified.
 */
private Parameter getServiceRefNameParam(Object sparseCompositeKey) {
  Parameter serviceRefNameParam = null;
  
  // The ServiceRefName, if specified, is set on the sparse composite associated with the service.
  String serviceRefName = getServiceDescriptionImpl().getDescriptionBuilderComposite().getServiceRefName(sparseCompositeKey);
  if (!DescriptionUtils.isEmpty(serviceRefName)) {
    if (log.isDebugEnabled()) {
      log.debug("Setting service ref name: " + serviceRefName 
          + " on AxisService: " + axisService + "@" + axisService.hashCode());
    }
    serviceRefNameParam = new Parameter();
    serviceRefNameParam.setName(MDQConstants.SERVICE_REF_NAME);
    serviceRefNameParam.setValue(serviceRefName);
  }
  return serviceRefNameParam;
}

代码示例来源:origin: wso2/wso2-synapse

/**
 * Iterate ParameterInclude and decrypt parameters if required.
 *
 * @param params ParameterInclude instance
 * @throws AxisFault
 */
private void decryptParamsIfRequired(ParameterInclude params) throws AxisFault {
  for (Parameter param : params.getParameters()) {
    if (param != null && param.getValue() != null && param.getValue() instanceof String) {
      param.setValue(decryptIfRequired(param.getValue().toString()));
    }
  }
}

代码示例来源:origin: apache/axis2-java

/**
 * Return a Parameter instance for ServiceRefName if that name was specified on the sparse composite when the Service was created.
 * @param sparseCompositeKey identifies the instance of the service (i.e. Service Delegate)
 * @return A Parameter containing the ServiceRefName or null if one was not specified.
 */
private Parameter getServiceRefNameParam(Object sparseCompositeKey) {
  Parameter serviceRefNameParam = null;
  
  // The ServiceRefName, if specified, is set on the sparse composite associated with the service.
  String serviceRefName = getServiceDescriptionImpl().getDescriptionBuilderComposite().getServiceRefName(sparseCompositeKey);
  if (!DescriptionUtils.isEmpty(serviceRefName)) {
    if (log.isDebugEnabled()) {
      log.debug("Setting service ref name: " + serviceRefName 
          + " on AxisService: " + axisService + "@" + axisService.hashCode());
    }
    serviceRefNameParam = new Parameter();
    serviceRefNameParam.setName(MDQConstants.SERVICE_REF_NAME);
    serviceRefNameParam.setValue(serviceRefName);
  }
  return serviceRefNameParam;
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public void setConfigContext(ConfigurationContext configContext) {
    // setting ServletContext into configctx
    configContext.setProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT,
                 config.getServletContext());
    Parameter servletConfigParam = new Parameter();
    servletConfigParam.setName(HTTPConstants.HTTP_SERVLETCONFIG);
    servletConfigParam.setValue(config);
    try {
      configContext.getAxisConfiguration().addParameter(servletConfigParam);
    } catch (AxisFault axisFault) {
      log.error(axisFault.getMessage(), axisFault);
    }
    super.setConfigContext(configContext);
  }
}

代码示例来源:origin: apache/axis2-java

public void setConfigContext(ConfigurationContext configContext) {
    // setting ServletContext into configctx
    configContext.setProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT,
                 config.getServletContext());
    Parameter servletConfigParam = new Parameter();
    servletConfigParam.setName(HTTPConstants.HTTP_SERVLETCONFIG);
    servletConfigParam.setValue(config);
    try {
      configContext.getAxisConfiguration().addParameter(servletConfigParam);
    } catch (AxisFault axisFault) {
      log.error(axisFault.getMessage(), axisFault);
    }
    super.setConfigContext(configContext);
  }
}

代码示例来源:origin: org.apache.synapse/synapse-core

public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault {
  AxisConfiguration axiConfiguration = configContext.getAxisConfiguration();
  Counter globalRequestCounter = new Counter();
  Parameter globalRequestCounterParameter = new Parameter();
  globalRequestCounterParameter.setName(MetricsConstants.GLOBAL_REQUEST_COUNTER);
  globalRequestCounterParameter.setValue(globalRequestCounter);
  axiConfiguration.addParameter(globalRequestCounterParameter);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-runtime-axis2

public void configureBinding(Object configuration) {
    
    if (configuration instanceof ConfigurationContext){
      ConfigurationContext configurationContext = (ConfigurationContext)configuration;
      configurationContext.getAxisConfiguration().getParameter(Configuration.ENABLE_MTOM).setLocked(false);
      configurationContext.getAxisConfiguration().getParameter(Configuration.ENABLE_MTOM).setValue("true");
    }
  }
}

代码示例来源:origin: wso2/wso2-synapse

public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault {
  AxisConfiguration axiConfiguration = configContext.getAxisConfiguration();
  Counter globalRequestCounter = new Counter();
  Parameter globalRequestCounterParameter = new Parameter();
  globalRequestCounterParameter.setName(MetricsConstants.GLOBAL_REQUEST_COUNTER);
  globalRequestCounterParameter.setValue(globalRequestCounter);
  axiConfiguration.addParameter(globalRequestCounterParameter);
}

代码示例来源:origin: org.apache.axis2/axis2-metadata

private void addToAxisService() {
  // Add a reference to this EndpointDescription object to the AxisService
  if (axisService != null) {
    Parameter parameter = new Parameter();
    parameter.setName(EndpointDescription.AXIS_SERVICE_PARAMETER);
    parameter.setValue(this);
    try {
      axisService.addParameter(parameter);
    } catch (AxisFault e) {
      throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescriptionErr5", EndpointDescription.AXIS_SERVICE_PARAMETER), e);
    }
  }
}

代码示例来源:origin: apache/axis2-java

private void addToAxisService() {
  // Add a reference to this EndpointDescription object to the AxisService
  if (axisService != null) {
    Parameter parameter = new Parameter();
    parameter.setName(EndpointDescription.AXIS_SERVICE_PARAMETER);
    parameter.setValue(this);
    try {
      axisService.addParameter(parameter);
    } catch (AxisFault e) {
      throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescriptionErr5", EndpointDescription.AXIS_SERVICE_PARAMETER), e);
    }
  }
}

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.statistics

private static void updateCurrentInvocationStatistic(MessageContext messageContext,
                             long responseTime) throws AxisFault {
    messageContext.setProperty(StatisticsConstants.GLOBAL_CURRENT_INVOCATION_RESPONSE_TIME,responseTime);

    if (messageContext.getAxisOperation() != null) {
      Parameter operationResponseTimeParam = new Parameter();
      operationResponseTimeParam.setName(StatisticsConstants.OPERATION_RESPONSE_TIME);
      operationResponseTimeParam.setValue(responseTime);
      messageContext.getAxisOperation().addParameter(operationResponseTimeParam);
    }

    if (messageContext.getAxisService() != null) {
      Parameter serviceResponseTimeParam = new Parameter();
      serviceResponseTimeParam.setName(StatisticsConstants.SERVICE_RESPONSE_TIME);
      serviceResponseTimeParam.setValue(responseTime);
      messageContext.getAxisService().addParameter(serviceResponseTimeParam);
    }
  }
}

代码示例来源:origin: wso2/wso2-synapse

/**
   * Invoking invoke method and assert for the incremented counter value
   * @throws Exception
   */
  public void testInvoke() throws Exception {
    GlobalRequestCountHandler globalRequestCountHandler = new GlobalRequestCountHandler();
    MessageContext messageContext;
    Counter counter = new Counter();
    Parameter parameter = new Parameter();
    parameter.setValue(counter);
    messageContext = Mockito.mock(MessageContext.class, Mockito.CALLS_REAL_METHODS);
    Mockito.doReturn(parameter).when(messageContext).getParameter(Mockito.anyString());
    Handler.InvocationResponse response = globalRequestCountHandler.invoke(messageContext);
    Assert.assertEquals("Asserting the response of the method",response, Handler.InvocationResponse.CONTINUE);
    Assert.assertEquals("Counter should be incremented to 1", counter.getCount(), 1);
  }
}

相关文章