Search in sources :

Example 1 with ConnectionFactoryFeature

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

the class Server method publishEndpoint.

/**
 * If you prefer to define the ConnectionFactory directly instead of using a JNDI look.
 *    // You can inject is like this:
 * @param impl
 * @param cf
 */
protected void publishEndpoint(Object impl, ConnectionFactory cf) {
    EndpointImpl epi = (EndpointImpl) Endpoint.create(impl);
    epi.setFeatures(Collections.singletonList(new ConnectionFactoryFeature(cf)));
    epi.publish();
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature)

Example 2 with ConnectionFactoryFeature

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

the class JmsServiceTest method greeterJms.

private static Greeter greeterJms() {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setServiceClass(Greeter.class);
    factory.setAddress("jms:queue:greeter");
    ConnectionFactory connectionFactory = createConnectionFactory();
    factory.setFeatures(Collections.singletonList(new ConnectionFactoryFeature(connectionFactory)));
    return factory.create(Greeter.class);
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) ConnectionFactory(javax.jms.ConnectionFactory) ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean)

Example 3 with ConnectionFactoryFeature

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

the class JmsTestActivator method publishService.

private Server publishService(ConnectionFactory connectionFactory) {
    JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
    factory.setServiceClass(Greeter.class);
    factory.setAddress("jms:queue:greeter");
    factory.setFeatures(Collections.singletonList(new ConnectionFactoryFeature(connectionFactory)));
    factory.setServiceBean(new GreeterImpl());
    return factory.create();
}
Also used : ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean)

Example 4 with ConnectionFactoryFeature

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

the class AbstractVmJMSTest method startBusAndJMS.

public static void startBusAndJMS(String brokerURI) {
    bus = BusFactory.getDefaultBus();
    ActiveMQConnectionFactory cf1 = new ActiveMQConnectionFactory(brokerURI);
    RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
    redeliveryPolicy.setMaximumRedeliveries(1);
    redeliveryPolicy.setInitialRedeliveryDelay(1000);
    cf1.setRedeliveryPolicy(redeliveryPolicy());
    cf = new PooledConnectionFactory(cf1);
    cff = new ConnectionFactoryFeature(cf);
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature) RedeliveryPolicy(org.apache.activemq.RedeliveryPolicy) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory)

Example 5 with ConnectionFactoryFeature

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

the class MultiTransportClientServerTest method startServers.

@BeforeClass
public static void startServers() throws Exception {
    bus = BusFactory.getDefaultBus();
    ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
    PooledConnectionFactory cfp = new PooledConnectionFactory(cf);
    cff = new ConnectionFactoryFeature(cfp);
    String address = "http://localhost:" + PORT + "/SOAPDocLitService/SoapPort";
    Endpoint.publish(address, new HTTPGreeterImpl());
    EndpointImpl ep1 = (EndpointImpl) Endpoint.create(new JMSGreeterImpl());
    ep1.setBus(bus);
    ep1.getFeatures().add(cff);
    ep1.publish();
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) HTTPGreeterImpl(org.apache.hello_world_doc_lit.HTTPGreeterImpl) ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) JMSGreeterImpl(org.apache.hello_world_doc_lit.JMSGreeterImpl) BeforeClass(org.junit.BeforeClass)

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