Search in sources :

Example 6 with ConnectionFactoryFeature

use of org.apache.cxf.transport.jms.ConnectionFactoryFeature in project cxf by apache.

the class ClientMtomXopWithJMSTest method startServers.

@BeforeClass
public static void startServers() throws Exception {
    Object implementor = new TestMtomJMSImpl();
    bus = BusFactory.getDefaultBus();
    ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
    PooledConnectionFactory cfp = new PooledConnectionFactory(cf);
    cff = new ConnectionFactoryFeature(cfp);
    EndpointImpl ep = (EndpointImpl) Endpoint.create(implementor);
    ep.getFeatures().add(cff);
    ep.getInInterceptors().add(new TestMultipartMessageInterceptor());
    ep.getOutInterceptors().add(new TestAttachmentOutInterceptor());
    // ep.getInInterceptors().add(new LoggingInInterceptor());
    // ep.getOutInterceptors().add(new LoggingOutInterceptor());
    SOAPBinding jaxWsSoapBinding = (SOAPBinding) ep.getBinding();
    jaxWsSoapBinding.setMTOMEnabled(true);
    ep.publish();
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) SOAPBinding(javax.xml.ws.soap.SOAPBinding) BeforeClass(org.junit.BeforeClass)

Example 7 with ConnectionFactoryFeature

use of org.apache.cxf.transport.jms.ConnectionFactoryFeature in project cxf by apache.

the class JMSTransactionTest method startBusAndJMS.

public static void startBusAndJMS(String brokerURI) {
    try {
        transactionManager = new GeronimoTransactionManager();
    } catch (XAException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
    bus = BusFactory.getDefaultBus();
    registerTransactionManager();
    ActiveMQXAConnectionFactory cf1 = new ActiveMQXAConnectionFactory(brokerURI);
    cf1.setRedeliveryPolicy(redeliveryPolicy());
    JcaPooledConnectionFactory pcf = new JcaPooledConnectionFactory();
    pcf.setTransactionManager(transactionManager);
    pcf.setConnectionFactory(cf1);
    cf = pcf;
    cff = new ConnectionFactoryFeature(pcf);
}
Also used : XAException(javax.transaction.xa.XAException) JcaPooledConnectionFactory(org.apache.activemq.jms.pool.JcaPooledConnectionFactory) ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature) GeronimoTransactionManager(org.apache.geronimo.transaction.manager.GeronimoTransactionManager) ActiveMQXAConnectionFactory(org.apache.activemq.ActiveMQXAConnectionFactory)

Aggregations

ConnectionFactoryFeature (org.apache.cxf.transport.jms.ConnectionFactoryFeature)7 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)4 PooledConnectionFactory (org.apache.activemq.pool.PooledConnectionFactory)3 EndpointImpl (org.apache.cxf.jaxws.EndpointImpl)3 BeforeClass (org.junit.BeforeClass)2 ConnectionFactory (javax.jms.ConnectionFactory)1 XAException (javax.transaction.xa.XAException)1 SOAPBinding (javax.xml.ws.soap.SOAPBinding)1 ActiveMQXAConnectionFactory (org.apache.activemq.ActiveMQXAConnectionFactory)1 RedeliveryPolicy (org.apache.activemq.RedeliveryPolicy)1 JcaPooledConnectionFactory (org.apache.activemq.jms.pool.JcaPooledConnectionFactory)1 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)1 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)1 GeronimoTransactionManager (org.apache.geronimo.transaction.manager.GeronimoTransactionManager)1 HTTPGreeterImpl (org.apache.hello_world_doc_lit.HTTPGreeterImpl)1 JMSGreeterImpl (org.apache.hello_world_doc_lit.JMSGreeterImpl)1