当前位置: 首页>>代码示例>>Java>>正文


Java Parameter.setName方法代码示例

本文整理汇总了Java中org.apache.axis2.description.Parameter.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Parameter.setName方法的具体用法?Java Parameter.setName怎么用?Java Parameter.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.description.Parameter的用法示例。


在下文中一共展示了Parameter.setName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: disableRESTCalls

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:24,代码来源:SecurityConfigAdmin.java

示例2: getTokenCancelerConfigParameter

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
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;
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:22,代码来源:RahasUtil.java

示例3: setUp

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
protected void setUp() throws Exception {
        targetEPR =
                new EndpointReference("http://127.0.0.1:"
                        + (UtilServer.TESTING_PORT)
//                        + 8000
                        + "/axis2/services/ComplexDataTypesDocLitBare");
        stub = new org.tempuri.complex.ComplexDataTypesDocLitBareStub(null, targetEPR.getAddress());
        String className = "org.tempuri.complex.ComplexDataTypesDocLitBare";
        UtilServer.start();
        Parameter generateBare = new Parameter();
        generateBare.setName(Java2WSDLConstants.DOC_LIT_BARE_PARAMETER);
        generateBare.setValue("true");
        UtilServer.getConfigurationContext().getAxisConfiguration().addParameter(generateBare);
        AxisService service = AxisService.createService(
                className, UtilServer.getConfigurationContext().getAxisConfiguration());
        service.addParameter(generateBare);
        service.setName("ComplexDataTypesDocLitBare");
        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        UtilServer.deployService(service);
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:ComplexDataTypesDocLitBareTest.java

示例4: testAddParameterServiceLockedAtAxisConfig

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterServiceLockedAtAxisConfig() {
    try {
        Parameter para = new Parameter();
        para.setValue(null);
        para.setName("PARA_NAME");
        para.setLocked(true);
        reg.addParameter(para);

        AxisService service = new AxisService("Service1");
        reg.addService(service);
        service.addParameter(para);
        fail("This should fails with Parmter is locked can not overide");
    } catch (AxisFault axisFault) {

    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:ParameterAddTest.java

示例5: updateCurrentInvocationStatistic

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:19,代码来源:ResponseTimeCalculator.java

示例6: testAddParameterOperationLockebyService

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterOperationLockebyService() {
    try {
        Parameter para = new Parameter();
        para.setValue(null);
        para.setName("PARA_NAME");
        para.setLocked(true);

        AxisService service = new AxisService("Service1");
        reg.addService(service);
        service.addParameter(para);

        AxisOperation opertion = new InOutAxisOperation();
        opertion.setParent(service);
        opertion.addParameter(para);
        fail("This should fails with Parmter is locked can not overide");
    } catch (AxisFault axisFault) {

    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:ParameterAddTest.java

示例7: overrideCallbackHandler

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public static void overrideCallbackHandler(AxisService service) throws AxisFault {
    Parameter cbHandlerParam = service.getParameter(WSHandlerConstants.PW_CALLBACK_REF);
    CallbackHandler handler = null;

    if (cbHandlerParam != null) {
        handler = (CallbackHandler) cbHandlerParam;
        service.removeParameter(cbHandlerParam);
        if (log.isDebugEnabled()) {
            log.debug("removedParameter");
        }
    }

    CallbackHandler cb = null;
    if (handler != null) {
        cb = handler;
    } else {
        cb = new IPPasswordCallbackHandler();
    }

    Parameter param = new Parameter();
    param.setName(WSHandlerConstants.PW_CALLBACK_REF);
    param.setValue(cb);
    service.addParameter(param);

    if (log.isDebugEnabled()) {
        log.debug("addedParameter");
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:29,代码来源:STSConfigAdmin.java

示例8: getPasswordCallBackRefParameter

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public static Parameter getPasswordCallBackRefParameter() throws AxisFault {
    Parameter param = new Parameter();
    param.setName(WSHandlerConstants.PW_CALLBACK_REF);
    try {
        param.setValue(new IPPasswordCallbackHandler());
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new AxisFault(e.getMessage(), e);
    }
    return param;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:12,代码来源:STSConfigAdmin.java

示例9: serviceUpdate

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
    if(SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup()) ||
        axisService.isClientSide()) {
        return;
    }
    if (axisEvent.getEventType() == AxisEvent.SERVICE_DEPLOY) {
        for (Iterator iter = axisService.getOperations(); iter.hasNext();) {
            AxisOperation op = (AxisOperation) iter.next();
            setCountersAndProcessors(op) ;
        }

        // set counters for default operation in case of JAX-WS backends
        // see

        // see ESBJAVA-2327
        if (JavaUtils.isTrueExplicitly(axisService.getParameterValue("disableOperationValidation"))){
              AxisOperation defaultOp = (AxisOperation) axisService.getParameterValue("_default_mediate_operation_");
              if(defaultOp != null ){
                   setCountersAndProcessors(defaultOp);
               }
        }

        // Service response time processor
        Parameter responseTimeProcessor = new Parameter();
        responseTimeProcessor.setName(StatisticsConstants.SERVICE_RESPONSE_TIME_PROCESSOR);
        responseTimeProcessor.setValue(new ResponseTimeProcessor());
        try {
            axisService.addParameter(responseTimeProcessor);
        } catch (AxisFault axisFault) { // will not occur
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:33,代码来源:SystemStatisticsDeploymentInterceptor.java

示例10: getScenarioId

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
private String getScenarioId(MessageContext msgCtx, AxisService service) throws SecurityConfigException {
    String scenarioID = null;
    try {
        scenarioID = (String) service.getParameter(SecurityConstants.SCENARIO_ID_PARAM_NAME).getValue();
    } catch (Exception e) {
    }//ignore

    if (scenarioID == null) {
        synchronized (this) {
            SecurityConfigAdmin securityAdmin = new SecurityConfigAdmin(msgCtx.
                    getConfigurationContext().getAxisConfiguration());
            SecurityScenarioData data = securityAdmin.getCurrentScenario(service.getName());
            if (data != null) {
                scenarioID = data.getScenarioId();
                try {
                    Parameter param = new Parameter();
                    param.setName(SecurityConstants.SCENARIO_ID_PARAM_NAME);
                    param.setValue(scenarioID);
                    service.addParameter(param);
                } catch (AxisFault axisFault) {
                    log.error("Error while adding Scenario ID parameter", axisFault);
                }
            }
        }
    }

    return scenarioID;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:29,代码来源:POXSecurityHandler.java

示例11: setConfigContext

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
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);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:15,代码来源:WarBasedAxisConfigurator.java

示例12: testAddParameterModuleLockedAtAxisConfig

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterModuleLockedAtAxisConfig() {
    try {
        Parameter para = new Parameter();
        para.setValue(null);
        para.setName("PARA_NAME");
        para.setLocked(true);
        reg.addParameter(para);
        AxisModule module = new AxisModule("Service1");
        module.setParent(reg);
        module.addParameter(para);
        fail("This should fails with Parmter is locked can not overide");
    } catch (AxisFault axisFault) {

    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:ParameterAddTest.java

示例13: addToAxisService

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:14,代码来源:EndpointDescriptionImpl.java

示例14: getParameter

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:13,代码来源:SchemaUnwrapperExtension.java

示例15: applySecurityParameters

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
private void applySecurityParameters(AxisService service, SecurityScenario secScenario,
                                     Policy policy) {
    try {

        UserRealm userRealm = (UserRealm) PrivilegedCarbonContext.getThreadLocalCarbonContext()
                .getUserRealm();

        UserRegistry govRegistry = (UserRegistry) PrivilegedCarbonContext
                .getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_GOVERNANCE);

        String serviceGroupId = service.getAxisServiceGroup().getServiceGroupName();
        String serviceName = service.getName();

        SecurityConfigParams configParams =
                SecurityConfigParamBuilder.getSecurityParams(getSecurityConfig(policy));

        // Set Trust (Rahas) Parameters
        if (secScenario.getModules().contains(SecurityConstants.TRUST_MODULE)) {
            AxisModule trustModule = service.getAxisConfiguration()
                    .getModule(SecurityConstants.TRUST_MODULE);
            if (log.isDebugEnabled()) {
                log.debug("Enabling trust module : " + SecurityConstants.TRUST_MODULE);
            }

            service.disengageModule(trustModule);
            service.engageModule(trustModule);

            Properties cryptoProps = new Properties();
            cryptoProps.setProperty(ServerCrypto.PROP_ID_PRIVATE_STORE,
                                    configParams.getPrivateStore());
            cryptoProps.setProperty(ServerCrypto.PROP_ID_DEFAULT_ALIAS,
                                    configParams.getKeyAlias());
            if (configParams.getTrustStores() != null) {
                cryptoProps.setProperty(ServerCrypto.PROP_ID_TRUST_STORES,
                                        configParams.getTrustStores());
            }
            service.addParameter(RahasUtil.getSCTIssuerConfigParameter(
                    ServerCrypto.class.getName(), cryptoProps, -1, null, true, true));

            service.addParameter(RahasUtil.getTokenCancelerConfigParameter());

        }

        // Authorization
        AuthorizationManager manager = userRealm.getAuthorizationManager();
        String resourceName = serviceGroupId + "/" + serviceName;
        removeAuthorization(userRealm, serviceGroupId, serviceName);
        String allowRolesParameter = configParams.getAllowedRoles();
        if (allowRolesParameter != null) {
            if (log.isDebugEnabled()) {
                log.debug("Authorizing roles " + allowRolesParameter);
            }
            String[] allowRoles = allowRolesParameter.split(",");
            if (allowRoles != null) {
                for (String role : allowRoles) {
                    manager.authorizeRole(role, resourceName,
                                          UserCoreConstants.INVOKE_SERVICE_PERMISSION);
                }
            }
        }

        // Password Callback Handler
        ServicePasswordCallbackHandler handler =
                new ServicePasswordCallbackHandler(configParams, serviceGroupId, serviceName,
                                                   govRegistry, userRealm);

        Parameter param = new Parameter();
        param.setName(WSHandlerConstants.PW_CALLBACK_REF);
        param.setValue(handler);
        service.addParameter(param);

    } catch (Throwable e) {
    //TODO: Copied from 4.2.2.
    //TODO: Not sure why we are catching throwable. Need to check error handling is correct
        String msg = "Cannot apply security parameters";
        log.error(msg, e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:79,代码来源:SecurityDeploymentInterceptor.java


注:本文中的org.apache.axis2.description.Parameter.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。