本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}