本文整理汇总了Java中org.apache.cxf.message.Message.getExchange方法的典型用法代码示例。如果您正苦于以下问题:Java Message.getExchange方法的具体用法?Java Message.getExchange怎么用?Java Message.getExchange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.message.Message
的用法示例。
在下文中一共展示了Message.getExchange方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testHandleMessage
import org.apache.cxf.message.Message; //导入方法依赖的package包/类
@Test
public void testHandleMessage() throws Exception
{
Message message = InterceptorStateHelper.getMessage( InterceptorState.SERVER_IN );
Exchange exchange = message.getExchange();
doReturn( message ).when( exchange ).getInMessage();
doReturn( request ).when( message ).get( AbstractHTTPDestination.HTTP_REQUEST );
doReturn( Common.DEFAULT_PUBLIC_SECURE_PORT ).when( request ).getLocalPort();
doReturn( "/rest/v1/peer" ).when( request ).getRequestURI();
interceptor.handleMessage( message );
verify( interceptor ).handlePeerMessage( anyString(), eq( message ) );
doReturn( "/rest/v1/env/123/" ).when( request ).getRequestURI();
interceptor.handleMessage( message );
verify( interceptor ).handleEnvironmentMessage( anyString(), anyString(), eq( message ) );
}
示例2: getServiceMethod
import org.apache.cxf.message.Message; //导入方法依赖的package包/类
/**
* Extracts the Method that will be invoked by the service from the Message object
*
* @param message Message to extract the method from
* @return Method that will be invoked by the service from the Message object
*/
private Method getServiceMethod(Message message) {
Exchange exchange = message.getExchange();
BindingOperationInfo bindingOperationInfo = exchange.get(BindingOperationInfo.class);
MethodDispatcher methodDispatcher = (MethodDispatcher)
exchange.get(Service.class).get(MethodDispatcher.class.getName());
return methodDispatcher.getMethod(bindingOperationInfo);
}
示例3: getOutMessage
import org.apache.cxf.message.Message; //导入方法依赖的package包/类
private Message getOutMessage(Message inMessage) {
Exchange exchange = inMessage.getExchange();
Message outMessage = exchange.getOutMessage();
if (outMessage == null) {
Endpoint endpoint = exchange.get(Endpoint.class);
outMessage = endpoint.getBinding().createMessage();
exchange.setOutMessage(outMessage);
}
outMessage.putAll(inMessage);
return outMessage;
}
示例4: getConduit
import org.apache.cxf.message.Message; //导入方法依赖的package包/类
private Conduit getConduit(Message inMessage) throws IOException {
Exchange exchange = inMessage.getExchange();
EndpointReferenceType target = exchange.get(EndpointReferenceType.class);
Conduit conduit =
exchange.getDestination().getBackChannel(inMessage, null, target);
exchange.setConduit(conduit);
return conduit;
}
示例5: filter
import org.apache.cxf.message.Message; //导入方法依赖的package包/类
@Override
public void filter(ClientRequestContext requestContext) throws IOException {
final Message message = JAXRSUtils.getCurrentMessage();
final Exchange exchange = message.getExchange();
final String methodName = String.valueOf(exchange.get(OPERATION_NAME_PROP));
message.put(HTTPClientPolicy.class, policyMap.get(methodName));
}
示例6: handleMessage
import org.apache.cxf.message.Message; //导入方法依赖的package包/类
public void handleMessage(Message message) throws Fault {
Exchange ex = message.getExchange();
// This test verifies that the "to" endpoint is not the from endpoint.
Endpoint endpoint = ex.get(Endpoint.class);
if ("http://localhost:9003/CamelContext/RouterPort".equals(endpoint.getEndpointInfo().getAddress())) {
throw new Fault(new Exception("bad endpoint " + endpoint.getEndpointInfo().getAddress()));
}
}