本文整理匯總了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()));
}
}