当前位置: 首页>>代码示例>>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;未经允许,请勿转载。