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


Java JavaUtils.isTrue方法代码示例

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


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

示例1: invoke

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
    Object flag = msgContext.getLocalProperty(IS_ADDR_INFO_ALREADY_PROCESSED);
    if (log.isTraceEnabled()) {
        log.trace("invoke: IS_ADDR_INFO_ALREADY_PROCESSED=" + flag);
    }

    if (JavaUtils.isTrueExplicitly(flag)) {
        // Check if the wsa:MessageID is required or not.
        checkMessageIDHeader(msgContext);
        
        // Check that if wsamInvocationPattern flag is in effect that the replyto and faultto are valid.
        if (JavaUtils.isTrue(msgContext.getProperty(ADDR_VALIDATE_INVOCATION_PATTERN), true)) {
            checkWSAMInvocationPattern(msgContext);
        }
    }
    else {
        // Check that if wsaddressing=required that addressing headers were found inbound
        checkUsingAddressing(msgContext);
    }

    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:AddressingValidationHandler.java

示例2: setDeploymentFeatures

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
/**
 * Sets hotDeployment and hot update.
 */
protected void setDeploymentFeatures() {
    Parameter hotDeployment = axisConfig.getParameter(TAG_HOT_DEPLOYMENT);
    Parameter hotUpdate = axisConfig.getParameter(TAG_HOT_UPDATE);

    if (hotDeployment != null) {
        this.hotDeployment = JavaUtils.isTrue(hotDeployment.getValue(), true);
    }

    if (hotUpdate != null) {
        this.hotUpdate = JavaUtils.isTrue(hotUpdate.getValue(), true);
    }

    String serviceDirPara = (String)
            axisConfig.getParameterValue(DeploymentConstants.SERVICE_DIR_PATH);
    if (serviceDirPara != null) {
        servicesPath = serviceDirPara;
    }

    String moduleDirPara = (String)
            axisConfig.getParameterValue(DeploymentConstants.MODULE_DRI_PATH);
    if (moduleDirPara != null) {
        modulesPath = moduleDirPara;
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:DeploymentEngine.java

示例3: getJaxwsProviderInterpretNullOneway

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
public static boolean getJaxwsProviderInterpretNullOneway(MessageContext mc){
    boolean retval = true;  // default is true
    org.apache.axis2.context.MessageContext ac = mc.getAxisMessageContext();
    if (ac == null) {
        if (log.isDebugEnabled()) {
            log.debug("getJaxwsProviderInterpretNullOneway returns true due to missing MessageContext");
        }
        return retval;
    }
    // First examine the JaxwsProviderInterpretNullOneway flag on the context hierarchy
    Boolean providerNullOneway = (Boolean) ac.getProperty(
            org.apache.axis2.jaxws.Constants.JAXWS_PROVIDER_NULL_ONEWAY);
    if (providerNullOneway != null) {
        retval = providerNullOneway.booleanValue();
        if (log.isDebugEnabled()) {
            log.debug("getJaxwsProviderInterpretNullOneway returns " + retval + " per Context property " + 
                    org.apache.axis2.jaxws.Constants.JAXWS_PROVIDER_NULL_ONEWAY);
        }
        return retval;
    }
    
    // Now look at the JaxwsProviderInterpretNullOneway parameter
    Parameter p = ac.getParameter(org.apache.axis2.jaxws.Constants.JAXWS_PROVIDER_NULL_ONEWAY);
    if (p != null) {
        retval = JavaUtils.isTrue(p.getValue());
        if (log.isDebugEnabled()) {
            log.debug("getJaxwsProviderInterpretNullOneway returns " + retval + " per inspection of Configuration property " + 
                    org.apache.axis2.jaxws.Constants.JAXWS_PROVIDER_NULL_ONEWAY);
        }
        return retval;
    }
  
    if (log.isDebugEnabled()) {
        log.debug("getJaxwsProviderInterpretNullOneway returns the default value: " + retval);
    }
    return retval;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:38,代码来源:MessageContextUtils.java

示例4: processSOAPRoleConfig

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
private void processSOAPRoleConfig(AxisConfiguration axisConfig, OMElement soaproleconfigElement) {
	if (soaproleconfigElement != null) {
		final boolean isUltimateReceiever = JavaUtils.isTrue(soaproleconfigElement.getAttributeValue(new QName(Constants.SOAP_ROLE_IS_ULTIMATE_RECEIVER_ATTRIBUTE)), true);
		ArrayList roles = new ArrayList();
		Iterator iterator = soaproleconfigElement.getChildrenWithName(new QName(Constants.SOAP_ROLE_ELEMENT));
		while (iterator.hasNext()) {
			OMElement roleElement = (OMElement) iterator.next();
			roles.add(roleElement.getText());
		}
		final List unmodifiableRoles = Collections.unmodifiableList(roles);
		try{
			RolePlayer rolePlayer = new RolePlayer(){
				public List getRoles() {
					return unmodifiableRoles;
				}
				public boolean isUltimateDestination() {
					return isUltimateReceiever;
				}
			};
			axisConfig.addParameter("rolePlayer", rolePlayer);
		} catch (AxisFault e) {
			if (log.isTraceEnabled()) {
				log.trace(
						"processTargetResolvers: Exception thrown initialising TargetResolver: " +
						e.getMessage());
			}
		}
	}
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:30,代码来源:AxisConfigBuilder.java

示例5: createClient

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
/**
 * Create an operation client with the appropriate message exchange pattern (MEP). This method
 * creates a full-function MEP client which can be used to exchange messages for a specific
 * operation. It configures the constructed operation client to use the current normal and
 * override options. This method is used internally, and also by generated client stub code.
 *
 * @param operationQName qualified name of operation (local name is operation name, namespace
 *                       URI is just the empty string)
 * @return client configured to talk to the given operation
 * @throws AxisFault if the operation is not found
 */
public OperationClient createClient(QName operationQName) throws AxisFault {
    // If we're configured to do so, clean up the last OperationContext (thus
    // releasing its resources) each time we create a new one.
    if (JavaUtils.isTrue(getOptions().getProperty(AUTO_OPERATION_CLEANUP), true) &&
            !getOptions().isUseSeparateListener()) {
        cleanupTransport();
    }

    AxisOperation axisOperation = axisService.getOperation(operationQName);
    if (axisOperation == null) {
        throw new AxisFault(Messages
                .getMessage("operationnotfound", operationQName.getLocalPart()));
    }

    // add the option properties to the service context
    String key;
    for (Object o : options.getProperties().keySet()) {
        key = (String)o;
        serviceContext.setProperty(key, options.getProperties().get(key));
    }
    OperationClient operationClient = axisOperation.createClient(serviceContext, options);

    // if overide options have been set, that means we need to make sure
    // those options override the options of even the operation client. So,
    // what we do is switch the parents around to make that work.
    if (overrideOptions != null) {
        overrideOptions.setParent(operationClient.getOptions());
        operationClient.setOptions(overrideOptions);
    }
    return operationClient;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:43,代码来源:ServiceClient.java

示例6: _isHighFidelity

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
/**
 * isHighFidelity
 * 
 * The JAX-WS engine attempts to stream data as fast as possible.
 * For example, the message payload may be transformed into a JAXB object early in the processing.
 * Unfortunately such transformations are lossy, some information is lost.
 * An installed SOAP handler will see different namespaces (etc) then the original message.
 * 
 * If the a customer enables the "jaxws.payload.highFidelity" flag, then lossy transformations are
 * avoided until necessary.  
 * 
 * @see Constants.JAXWS_HIGH_FIDELITY
 * 
 * @param mc
 * @return true if high fidelity is requested
 */
private static boolean _isHighFidelity(MessageContext mc) {
    
    boolean value = false;
    if (mc == null) {
        if (log.isDebugEnabled()) {
            log.debug("_isHighFidelity returns false due to missing MessageContext");
        }
        return false;
    }
    
    // First examine the high fidelity flag on the context hierarchy
    Boolean highFidelity = (Boolean) mc.getProperty(
            org.apache.axis2.jaxws.Constants.JAXWS_PAYLOAD_HIGH_FIDELITY);
    if (highFidelity != null) {
        value = highFidelity.booleanValue();
        if (log.isDebugEnabled()) {
            log.debug("_isHighFidelity returns " + value + " per Context property " + 
                    org.apache.axis2.jaxws.Constants.JAXWS_PAYLOAD_HIGH_FIDELITY);
        }
        return value;
    }
    
    // Second examine the deprecated jaxb streaming flag
    Boolean jaxbStreaming = (Boolean) mc.getProperty(
            org.apache.axis2.jaxws.Constants.JAXWS_ENABLE_JAXB_PAYLOAD_STREAMING);
    if (jaxbStreaming != null) {
        value = !jaxbStreaming.booleanValue();
        if (log.isDebugEnabled()) {
            log.debug("_isHighFidelity returns " + value + " per inspection of Context property " + 
                    org.apache.axis2.jaxws.Constants.JAXWS_ENABLE_JAXB_PAYLOAD_STREAMING);
        }
        return value;
    }
    
    // Now look at the high fidelity parameter
    Parameter p = mc.getParameter(org.apache.axis2.jaxws.Constants.JAXWS_PAYLOAD_HIGH_FIDELITY);
    if (p != null) {
        value = JavaUtils.isTrue(p.getValue());
        if (log.isDebugEnabled()) {
            log.debug("_isHighFidelity returns " + value + " per inspection of Configuration property " + 
                    org.apache.axis2.jaxws.Constants.JAXWS_PAYLOAD_HIGH_FIDELITY);
        }
        return value;
    }
    
    if (log.isDebugEnabled()) {
        log.debug("_isHighFidelity returns the default: false");
    }
    return false;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:67,代码来源:HandlerUtils.java

示例7: invoke

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
/**
     * @param msgctx
     * @throws org.apache.axis2.AxisFault
     * @noinspection MethodReturnOfConcreteClass
     */
    public InvocationResponse invoke(MessageContext msgctx) throws AxisFault {
        InvocationResponse response = InvocationResponse.CONTINUE;
        
        // first check we can dispatch using the relates to
        if (msgctx.getRelatesTo() != null) {
            String relatesTo = msgctx.getRelatesTo().getValue();

            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("checkingrelatesto",
                                                                              relatesTo));
            }
            if (relatesTo != null && !"".equals(relatesTo) && (msgctx.getOperationContext()==null)) {
                OperationContext operationContext =
                        msgctx.getConfigurationContext()
                                .getOperationContext(relatesTo);

                if (operationContext != null) //noinspection TodoComment
                {
//                    if(operationContext.isComplete()){
//                        // If the dispatch happens because of the RelatesTo and the mep is complete
//                        // we should throw a more descriptive fault.
//                        throw new AxisFault(Messages.getMessage("duplicaterelatesto",relatesTo));
//                    }
                    msgctx.setAxisOperation(operationContext.getAxisOperation());
                    msgctx.setAxisMessage(operationContext.getAxisOperation().getMessage(
                                                                WSDLConstants.MESSAGE_LABEL_IN_VALUE));
                    msgctx.setOperationContext(operationContext);
                    msgctx.setServiceContext((ServiceContext) operationContext.getParent());
                    msgctx.setAxisService(
                            ((ServiceContext) operationContext.getParent()).getAxisService());

                    // TODO : Is this necessary here?
                    msgctx.getAxisOperation().registerMessageContext(msgctx, operationContext);

                    msgctx.setServiceGroupContextId(
                            ((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());

                    if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                        log.debug(msgctx.getLogIDString() +
                                " Dispatched successfully on the RelatesTo. operation=" +
                                operationContext.getAxisOperation());
                    }
                }
            }
        }
        //Else we will try to dispatch based on the WS-A Action
        else {
            response = super.invoke(msgctx);
            Object flag = msgctx.getLocalProperty(IS_ADDR_INFO_ALREADY_PROCESSED);
            if (log.isTraceEnabled()) {
                log.trace("invoke: IS_ADDR_INFO_ALREADY_PROCESSED=" + flag);
            }

            if (JavaUtils.isTrueExplicitly(flag)) {
                // If no AxisOperation has been found at the end of the dispatch phase and addressing
                // is in use we should throw an ActionNotSupported Fault, unless we've been told
                // not to do this check (by Synapse, for instance)
                if (JavaUtils.isTrue(msgctx.getProperty(ADDR_VALIDATE_ACTION), true)) {
                    checkAction(msgctx);
                }
            }
        }
        
        return response;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:71,代码来源:AddressingBasedDispatcher.java

示例8: DefaultSchemaGenerator

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
public DefaultSchemaGenerator(ClassLoader loader, String className,
                              String schematargetNamespace,
                              String schematargetNamespacePrefix,
                              AxisService service)
        throws Exception {
    this.classLoader = loader;
    this.className = className;
    this.service = service;

    serviceClass = Class.forName(className, true, loader);
    methodTable = new MethodTable(serviceClass);

    this.targetNamespace = Java2WSDLUtils.targetNamespaceFromClassName(
            className, loader, getNsGen()).toString();

    if (schematargetNamespace != null
            && schematargetNamespace.trim().length() != 0) {
        this.schemaTargetNameSpace = schematargetNamespace;
    } else {
        this.schemaTargetNameSpace =
                Java2WSDLUtils.schemaNamespaceFromClassName(className, loader, getNsGen())
                        .toString();
    }

    if (schematargetNamespacePrefix != null
            && schematargetNamespacePrefix.trim().length() != 0) {
        this.schema_namespace_prefix = schematargetNamespacePrefix;
    } else {
        this.schema_namespace_prefix = SCHEMA_NAMESPACE_PRFIX;
    }
    if (service !=null ) {
        Parameter sortAtt = service.getParameter("SortAttributes");
        if (sortAtt !=null && "false".equals(sortAtt.getValue())){
            sortAttributes = false;
        }

        Parameter generateWrappedArrayTypes = service.getParameter("generateWrappedArrayTypes");
        if ((generateWrappedArrayTypes != null) && JavaUtils.isTrue(generateWrappedArrayTypes.getValue())){
           isGenerateWrappedArrayTypes = true;
        }

        Parameter extraClassesParam = service.getParameter("extraClass");
        if (extraClassesParam != null){
            String extraClassesString = (String) extraClassesParam.getValue();
            String[] extraClassesArray = extraClassesString.split(",");
            if (this.extraClasses == null){
                this.extraClasses = new ArrayList<String>();
            }

            for (String extraClass : extraClassesArray){
                this.extraClasses.add(extraClass);
            }
        }
    }




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

示例9: isParameterTrue

import org.apache.axis2.util.JavaUtils; //导入方法依赖的package包/类
public boolean isParameterTrue(String name) {
    Parameter param = getParameter(name);
    return param != null && JavaUtils.isTrue(param.getValue());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:5,代码来源:AxisDescription.java


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