本文整理汇总了Java中org.apache.cxf.message.Exchange.getInMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Exchange.getInMessage方法的具体用法?Java Exchange.getInMessage怎么用?Java Exchange.getInMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.message.Exchange
的用法示例。
在下文中一共展示了Exchange.getInMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEncoding
import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
private String getEncoding(Message message)
{
Exchange ex = message.getExchange();
String encoding = (String)message.get(Message.ENCODING);
if (encoding == null && ex.getInMessage() != null)
{
encoding = (String) ex.getInMessage().get(Message.ENCODING);
message.put(Message.ENCODING, encoding);
}
if (encoding == null)
{
encoding = "UTF-8";
message.put(Message.ENCODING, encoding);
}
return encoding;
}
示例2: getEncoding
import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
protected String getEncoding(Message message)
{
Exchange ex = message.getExchange();
String encoding = (String)message.get(Message.ENCODING);
if (encoding == null && ex.getInMessage() != null)
{
encoding = (String) ex.getInMessage().get(Message.ENCODING);
message.put(Message.ENCODING, encoding);
}
if (encoding == null)
{
encoding = "UTF-8";
message.put(Message.ENCODING, encoding);
}
return encoding;
}
示例3: closeConduit
import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
public static void closeConduit(Exchange exchange) throws IOException {
ConduitSelector conduitSelector = null;
synchronized (exchange) {
conduitSelector = exchange.get(ConduitSelector.class);
if (conduitSelector != null) {
exchange.remove(ConduitSelector.class.getName());
}
}
Conduit selectedConduit = null;
Message message = exchange.getInMessage() == null ? exchange
.getOutMessage() : exchange.getInMessage();
if (conduitSelector != null && message != null) {
selectedConduit = conduitSelector.selectConduit(message);
selectedConduit.close(message);
}
//TODO the line below was removed, check the impact on the protobuffer importer/exporter
//selectedConduit.close(message);
}
示例4: isAsyncInvocationSupported
import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
protected boolean isAsyncInvocationSupported(Exchange cxfExchange) {
Message cxfMessage = cxfExchange.getInMessage();
Object addressingProperties = cxfMessage.get(CxfConstants.WSA_HEADERS_INBOUND);
if (addressingProperties != null
&& !ContextUtils.isGenericAddress(getReplyTo(addressingProperties))) {
//it's decoupled endpoint, so already switch thread and
//use executors, which means underlying transport won't
//be block, so we shouldn't rely on continuation in
//this case, as the SuspendedInvocationException can't be
//caught by underlying transport. So we should use the SyncInvocation this time
return false;
}
// we assume it should support AsyncInvocation out of box
return true;
}
示例5: getClassLoader
import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
private ClassLoader getClassLoader(final Exchange exchange) {
final Message inMessage = exchange.getInMessage();
if (inMessage == null) {
return null;
}
final OpenEJBPerRequestPojoResourceProvider requestPojoResourceProvider = inMessage.get(OpenEJBPerRequestPojoResourceProvider.class);
if (requestPojoResourceProvider != null) {
return requestPojoResourceProvider.getClassLoader();
}
return null;
}
示例6: complete
import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
/**
* Called on completion of the MEP for which the Conduit was required.
*
* @param exchange
* represents the completed MEP
*/
public void complete(Exchange exchange) {
InvocationKey key = new InvocationKey(exchange);
InvocationContext invocation = getInvocation(key);
boolean failover = false;
Conduit old = (Conduit) exchange.getOutMessage().remove(Conduit.class.getName());
if (requiresFailover(exchange)) {
onFailure(invocation.getContext());
LOG.debug("Failover {}", invocation.getContext());
Endpoint failoverTarget = getFailoverTarget(exchange, invocation);
if (failoverTarget != null) {
setEndpoint(failoverTarget);
if (old != null) {
old.close();
conduits.remove(old);
}
failover = performFailover(exchange, invocation);
}
} else {
if (invocation != null) {
onSuccess(invocation.getContext());
}
}
if (!failover) {
LOG.debug("Failover not required");
synchronized (this) {
inProgress.remove(key);
}
if (MessageUtils.isTrue(exchange.get("KeepConduitAlive"))) {
return;
}
try {
if (exchange.getInMessage() != null) {
Conduit c = (Conduit) exchange.getOutMessage().get(Conduit.class);
if (c == null) {
getSelectedConduit(exchange.getInMessage()).close(exchange.getInMessage());
} else {
c.close(exchange.getInMessage());
}
}
} catch (IOException e) {
}
}
}