Search in sources :

Example 1 with TransactionHelperImpl

use of org.jboss.narayana.jta.jms.TransactionHelperImpl in project narayana by jbosstm.

the class AbstractIntegrationTests method initJms.

protected void initJms() throws Exception {
    jmsServer = JMS_HELPER.startServer();
    queue = (Queue) jmsServer.lookup(JmsHelper.QUEUE_NAME);
    ConnectionFactory connectionFactory = new ConnectionFactoryProxy((XAConnectionFactory) jmsServer.lookup(JmsHelper.FACTORY_NAME), new TransactionHelperImpl(TransactionManager.transactionManager()));
    connection = connectionFactory.createConnection();
    connection.start();
}
Also used : ConnectionFactoryProxy(org.jboss.narayana.jta.jms.ConnectionFactoryProxy) XAConnectionFactory(javax.jms.XAConnectionFactory) ConnectionFactory(javax.jms.ConnectionFactory) TransactionHelperImpl(org.jboss.narayana.jta.jms.TransactionHelperImpl)

Example 2 with TransactionHelperImpl

use of org.jboss.narayana.jta.jms.TransactionHelperImpl in project spring-boot by spring-projects.

the class NarayanaXAConnectionFactoryWrapper method wrapConnectionFactory.

@Override
public ConnectionFactory wrapConnectionFactory(XAConnectionFactory xaConnectionFactory) {
    XAResourceRecoveryHelper recoveryHelper = getRecoveryHelper(xaConnectionFactory);
    this.recoveryManager.registerXAResourceRecoveryHelper(recoveryHelper);
    return new ConnectionFactoryProxy(xaConnectionFactory, new TransactionHelperImpl(this.transactionManager));
}
Also used : ConnectionFactoryProxy(org.jboss.narayana.jta.jms.ConnectionFactoryProxy) TransactionHelperImpl(org.jboss.narayana.jta.jms.TransactionHelperImpl) JmsXAResourceRecoveryHelper(org.jboss.narayana.jta.jms.JmsXAResourceRecoveryHelper) XAResourceRecoveryHelper(com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper)

Example 3 with TransactionHelperImpl

use of org.jboss.narayana.jta.jms.TransactionHelperImpl in project jbpm by kiegroup.

the class AsyncAuditLogProducerTest method startHornetQServer.

private void startHornetQServer() throws Exception {
    jmsServer = new EmbeddedJMS();
    jmsServer.start();
    logger.debug("Started Embedded JMS Server");
    XAConnectionFactory connectionFactory = (XAConnectionFactory) jmsServer.lookup("ConnectionFactory");
    new InitialContext().rebind("java:comp/UserTransaction", com.arjuna.ats.jta.UserTransaction.userTransaction());
    new InitialContext().rebind("java:comp/TransactionManager", com.arjuna.ats.jta.TransactionManager.transactionManager());
    new InitialContext().rebind("java:comp/TransactionSynchronizationRegistry", new com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple());
    factory = new ConnectionFactoryProxy(connectionFactory, new TransactionHelperImpl(com.arjuna.ats.jta.TransactionManager.transactionManager()));
    queue = (Queue) jmsServer.lookup("/queue/exampleQueue");
}
Also used : ConnectionFactoryProxy(org.jboss.narayana.jta.jms.ConnectionFactoryProxy) EmbeddedJMS(org.hornetq.jms.server.embedded.EmbeddedJMS) TransactionHelperImpl(org.jboss.narayana.jta.jms.TransactionHelperImpl) XAConnectionFactory(javax.jms.XAConnectionFactory) InitialContext(javax.naming.InitialContext)

Example 4 with TransactionHelperImpl

use of org.jboss.narayana.jta.jms.TransactionHelperImpl in project jbpm by kiegroup.

the class JmsAvaiableJobExecutorTest method startHornetQServer.

private void startHornetQServer() throws Exception {
    jmsServer = new EmbeddedJMS();
    jmsServer.start();
    logger.debug("Started Embedded JMS Server");
    XAConnectionFactory connectionFactory = (XAConnectionFactory) jmsServer.lookup("ConnectionFactory");
    new InitialContext().rebind("java:comp/UserTransaction", com.arjuna.ats.jta.UserTransaction.userTransaction());
    new InitialContext().rebind("java:comp/TransactionManager", com.arjuna.ats.jta.TransactionManager.transactionManager());
    new InitialContext().rebind("java:comp/TransactionSynchronizationRegistry", new com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple());
    factory = new ConnectionFactoryProxy(connectionFactory, new TransactionHelperImpl(com.arjuna.ats.jta.TransactionManager.transactionManager()));
    queue = (Queue) jmsServer.lookup("/queue/exampleQueue");
}
Also used : ConnectionFactoryProxy(org.jboss.narayana.jta.jms.ConnectionFactoryProxy) EmbeddedJMS(org.hornetq.jms.server.embedded.EmbeddedJMS) TransactionHelperImpl(org.jboss.narayana.jta.jms.TransactionHelperImpl) XAConnectionFactory(javax.jms.XAConnectionFactory) InitialContext(javax.naming.InitialContext)

Aggregations

ConnectionFactoryProxy (org.jboss.narayana.jta.jms.ConnectionFactoryProxy)4 TransactionHelperImpl (org.jboss.narayana.jta.jms.TransactionHelperImpl)4 XAConnectionFactory (javax.jms.XAConnectionFactory)3 InitialContext (javax.naming.InitialContext)2 EmbeddedJMS (org.hornetq.jms.server.embedded.EmbeddedJMS)2 XAResourceRecoveryHelper (com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper)1 ConnectionFactory (javax.jms.ConnectionFactory)1 JmsXAResourceRecoveryHelper (org.jboss.narayana.jta.jms.JmsXAResourceRecoveryHelper)1