當前位置: 首頁>>代碼示例>>Java>>正文


Java Message.getExchange方法代碼示例

本文整理匯總了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 ) );
}
 
開發者ID:subutai-io,項目名稱:base,代碼行數:21,代碼來源:ServerInInterceptorTest.java

示例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);
}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:14,代碼來源:CxfFunctionGuardInterceptor.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:sistra,代碼行數:12,代碼來源:BasicAuthAuthorizationInterceptor.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:sistra,代碼行數:9,代碼來源:BasicAuthAuthorizationInterceptor.java

示例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));
}
 
開發者ID:Microbule,項目名稱:microbule,代碼行數:8,代碼來源:TimeoutFilter.java

示例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()));
    }
    
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:11,代碼來源:TestCxfFeature.java


注:本文中的org.apache.cxf.message.Message.getExchange方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。