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


Java Context.getPropertyValue方法代码示例

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


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

示例1: getContextProperty

import org.switchyard.Context; //导入方法依赖的package包/类
private String getContextProperty(Context context, String name) {
    Object p = context.getPropertyValue(name);
    if (p instanceof SOAPHeaderElement) {
        return ((SOAPHeaderElement)p).getValue();
    } else if (p != null) {
        return p.toString();
    }
    return null;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:10,代码来源:AddressingInterceptor.java

示例2: getDestinationTypeFromContext

import org.switchyard.Context; //导入方法依赖的package包/类
protected DestinationType getDestinationTypeFromContext(Context ctx) {
    DestinationType destType = _defaultDestinationType;
    String key = CONTEXT_PROPERTY_PREFIX + KEY_DESTINATION_TYPE;
    if (ctx.getProperty(key) != null) {
        String type = ctx.getPropertyValue(key);
        DestinationType ctxType = parseDestinationType(type);
        if (ctxType != null) {
            destType = ctxType;
            if (_logger.isDebugEnabled()) {
                _logger.debug("Destination type is set to '" + destType.toString() + "'");
            }
        }
    }
    return destType;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:16,代码来源:JMSProcessor.java

示例3: process

import org.switchyard.Context; //导入方法依赖的package包/类
@Override
public String process(String content) {
    Context msgContext = exchange.getMessage().getContext();
    HttpRequestInfo requestInfo = msgContext.getPropertyValue(HttpComposition.HTTP_REQUEST_INFO);
    LOGGER.info("********************************************************************************");
    LOGGER.info("method      = {}", requestInfo.getMethod());
    LOGGER.info("pathInfo    = {}", requestInfo.getPathInfo());
    LOGGER.info("queryString = {}", requestInfo.getQueryString());
    LOGGER.info("content     = {}", content);
    LOGGER.info("********************************************************************************");
    return invoke(requestInfo, content);
}
 
开发者ID:tadayosi,项目名称:samples-switchyard,代码行数:13,代码来源:ProxyBean.java

示例4: getDestinationFromContext

import org.switchyard.Context; //导入方法依赖的package包/类
protected Destination getDestinationFromContext(Session session, Context ctx) throws Exception {
    Destination destination = null;

    String key = CONTEXT_PROPERTY_PREFIX + KEY_DESTINATION;
    if (ctx.getProperty(key) != null) {
        String destName = ctx.getPropertyValue(key);
        DestinationType destType = getDestinationTypeFromContext(ctx);
        
        try {
            switch (destType) {
            case JNDI:
                destination = lookupDestinationFromJNDI(destName);
                break;
            case Queue:
                destination = session.createQueue(destName);
                break;
            case Topic:
                destination = session.createTopic(destName);
                break;
            }
            if (_logger.isDebugEnabled()) {
                _logger.debug("Destination is set to '" + destName + "'");
            }
        } catch (Exception e) {
            JCALogger.ROOT_LOGGER.contextDestinationNotFound(destName, _defaultDestination);
            if (_logger.isDebugEnabled()) {
                _logger.debug(e);
            }
        }
    }
    
    // No valid destination is specified in a context property - use default
    if (destination == null) {
        switch (_defaultDestinationType) {
        case JNDI:
            destination = _defaultJmsDestination;
            break;
        case Queue:
            destination = session.createQueue(_defaultDestination);
            break;
        case Topic:
            destination = session.createTopic(_defaultDestination);
            break;
        }
    }
    return destination;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:48,代码来源:JMSProcessor.java

示例5: getObject

import org.switchyard.Context; //导入方法依赖的package包/类
/**
 * Gets an Object context property.
 * @param exchange the exchange
 * @param message the message
 * @param name the name
 * @return the property
 */
protected Object getObject(Exchange exchange, Message message, String name) {
    Context context = message != null ? exchange.getContext(message) : exchange.getContext();
    return context.getPropertyValue(name);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:12,代码来源:KnowledgeExchangeHandler.java

示例6: getObject

import org.switchyard.Context; //导入方法依赖的package包/类
/** Gets an Object context property.
 * 
 * @param exchange the exchange
 * @param message the message
 * @param name the name
 * @return the property */
protected Object getObject(Exchange exchange, Message message, String name) {
    Context context = message != null ? exchange.getContext(message) : exchange.getContext();
    return context.getPropertyValue(name);
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:11,代码来源:KnowledgeExchangeHandler.java


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