Search in sources :

Example 1 with JMSDestination

use of org.apache.cxf.transport.jms.JMSDestination in project tesb-rt-se by Talend.

the class CallbackActionInterceptor method handleAddressing.

private void handleAddressing(SoapMessage message) {
    final AddressingProperties maps = (AddressingProperties) message.getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND);
    if (maps == null) {
        return;
    }
    final EndpointReferenceType rpl = maps.getReplyTo();
    if (rpl == null) {
        return;
    }
    final AttributedURIType addr = rpl.getAddress();
    if (addr == null) {
        return;
    }
    final String replyTo = addr.getValue();
    final Exchange exchange = message.getExchange();
    if (exchange.getDestination() instanceof JMSDestination) {
        ContextUtils.storePartialResponseSent(message);
        if (!exchange.isOneWay()) {
            exchange.setOneWay(true);
        }
    } else {
        if (exchange.isOneWay()) {
            if (!Names.WSA_NONE_ADDRESS.equals(replyTo)) {
                // disable creation of "partial" response
                // by CXF decoupled response feature
                exchange.setOneWay(false);
            }
        } else {
            // and convert it afterwards to one-way.
            if (Names.WSA_NONE_ADDRESS.equals(replyTo)) {
                addr.setValue(Names.WSA_ANONYMOUS_ADDRESS);
            }
        }
    }
}
Also used : Exchange(org.apache.cxf.message.Exchange) EndpointReferenceType(org.apache.cxf.ws.addressing.EndpointReferenceType) JMSDestination(org.apache.cxf.transport.jms.JMSDestination) AttributedURIType(org.apache.cxf.ws.addressing.AttributedURIType) AddressingProperties(org.apache.cxf.ws.addressing.AddressingProperties)

Example 2 with JMSDestination

use of org.apache.cxf.transport.jms.JMSDestination in project tesb-rt-se by Talend.

the class DurableSubscriptionFeature method initialize.

@Override
public void initialize(Server server, Bus bus) {
    Destination destination = server.getDestination();
    if (destination instanceof JMSDestination) {
        JMSConfiguration jmsConfig = ((JMSDestination) destination).getJmsConfig();
        updateJMSConfig(jmsConfig);
    }
}
Also used : JMSDestination(org.apache.cxf.transport.jms.JMSDestination) Destination(org.apache.cxf.transport.Destination) JMSConfiguration(org.apache.cxf.transport.jms.JMSConfiguration) JMSDestination(org.apache.cxf.transport.jms.JMSDestination)

Example 3 with JMSDestination

use of org.apache.cxf.transport.jms.JMSDestination in project tesb-rt-se by Talend.

the class DurableSubscriptionFeatureTest method testDurableSubscriptionFeature2.

@Test
public void testDurableSubscriptionFeature2() throws Exception {
    DurableSubscriptionFeature f = new DurableSubscriptionFeature();
    f.setDurableSubscriptionName("durableSubscriptionName");
    f.setDurableSubscriptionClientId("durableSubscriptionClientId");
    JMSConfiguration jmsConfig = new JMSConfiguration();
    JMSDestination destination = createMock(JMSDestination.class);
    expect(destination.getJmsConfig()).andReturn(jmsConfig).anyTimes();
    replay(destination);
    Server server = createMock(Server.class);
    expect(server.getDestination()).andReturn(destination).anyTimes();
    replay(server);
    Bus bus = createNiceMock(Bus.class);
    f.initialize(server, bus);
    assertSame("durableSubscriptionName", jmsConfig.getDurableSubscriptionName());
    assertSame("durableSubscriptionClientId", jmsConfig.getDurableSubscriptionClientId());
}
Also used : Bus(org.apache.cxf.Bus) JMSConfiguration(org.apache.cxf.transport.jms.JMSConfiguration) JMSDestination(org.apache.cxf.transport.jms.JMSDestination) Server(org.apache.cxf.endpoint.Server) Test(org.junit.Test)

Aggregations

JMSDestination (org.apache.cxf.transport.jms.JMSDestination)3 JMSConfiguration (org.apache.cxf.transport.jms.JMSConfiguration)2 Bus (org.apache.cxf.Bus)1 Server (org.apache.cxf.endpoint.Server)1 Exchange (org.apache.cxf.message.Exchange)1 Destination (org.apache.cxf.transport.Destination)1 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)1 AttributedURIType (org.apache.cxf.ws.addressing.AttributedURIType)1 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)1 Test (org.junit.Test)1