Java Code Examples for org.springframework.jms.connection.JmsTransactionManager

Following code examples demonstrate how to use org.springframework.jms.connection.JmsTransactionManager from spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.jms.connection.JmsTransactionManager and various code implementation of this class.
Example 1
Project : spring-framework Source File : RFQRuntimeExceptionTest.java View Source Code on GitHub

	private void addTestJmsComponent() {

		org.springframework.jms.connection.JmsTransactionManager transactionManager = new org.springframework.jms.connection.JmsTransactionManager();
		transactionManager.setConnectionFactory(connectionFactory);

		ActiveMQComponent c = new ActiveMQComponent();
		c.setConnectionFactory(connectionFactory);
		c.setTransacted(true);

		c.setTransactionManager((JmsTransactionManager) context.getRegistry()
				.lookup("txManager"));
		context.addComponent("jms", c);

	}
			
Example 2
Project : spring-framework Source File : RFQRuntimeExceptionTest.java View Source Code on GitHub

	protected JndiRegistry createRegistry() throws Exception {
		JndiRegistry reg = super.createRegistry();

		org.springframework.jms.connection.JmsTransactionManager transactionManager = new org.springframework.jms.connection.JmsTransactionManager();
		transactionManager.setConnectionFactory(connectionFactory);
		reg.bind("txManager", transactionManager);

		SpringTransactionPolicy txPolicy = new SpringTransactionPolicy();
		txPolicy.setTransactionManager(transactionManager);
		txPolicy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
		reg.bind("required", txPolicy);

		return reg;
	}
			
Example 3
Project : spring-framework Source File : TestWithNoJpaFlushAndJmsTransactions.java View Source Code on GitHub

    @Override
    protected ActiveMQConfiguration createActiveMQConfiguration()
    {
        ActiveMQConfiguration config = super.createActiveMQConfiguration();
        config.setTransactionManager(new JmsTransactionManager(config.getConnectionFactory()));
        return config;
    }
			
Example 4
Project : spring-framework Source File : JmsConfiguration.java View Source Code on GitHub

  @Bean
  public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(
      ConnectionFactory connectionFactory,
      JmsTransactionManager transactionManager) {
    DefaultJmsListenerContainerFactory factory =
        new DefaultJmsListenerContainerFactory();
    factory.setConnectionFactory(connectionFactory);
    factory.setTransactionManager(transactionManager);
    return factory;
  }
			
Example 5
Project : spring-framework Source File : JMSToSplitterToCBRRouteBuilderTest.java View Source Code on GitHub

	private void addTestJmsComponent() {

		org.springframework.jms.connection.JmsTransactionManager transactionManager = new org.springframework.jms.connection.JmsTransactionManager();
		transactionManager.setConnectionFactory(connectionFactory);

		ActiveMQComponent c = new ActiveMQComponent();
		c.setConnectionFactory(connectionFactory);
		c.setTransacted(true);

		c.setTransactionManager((JmsTransactionManager) context.getRegistry()
				.lookup("txManager"));
		context.addComponent("jms", c);

	}
			
Example 6
Project : spring-framework Source File : JMSToSplitterToCBRRouteBuilderTest.java View Source Code on GitHub

	protected JndiRegistry createRegistry() throws Exception {
		JndiRegistry reg = super.createRegistry();

		org.springframework.jms.connection.JmsTransactionManager transactionManager = new org.springframework.jms.connection.JmsTransactionManager();
		transactionManager.setConnectionFactory(connectionFactory);
		reg.bind("txManager", transactionManager);

		SpringTransactionPolicy txPolicy = new SpringTransactionPolicy();
		txPolicy.setTransactionManager(transactionManager);
		txPolicy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
		reg.bind("required", txPolicy);

		return reg;
	}
			
Example 7
Project : spring-framework Source File : ListenerConfig.java View Source Code on GitHub

    public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(ConnectionFactory connectionFactory) {
        DefaultJmsListenerContainerFactory factory =  new DefaultJmsListenerContainerFactory();
        factory.setConnectionFactory(connectionFactory);
        factory.setTransactionManager(new JmsTransactionManager(connectionFactory));
        factory.setSubscriptionDurable(true);
        return factory;
    }
			
Example 8
Project : spring-framework Source File : TestWithJpaFlushAndJmsTransactions.java View Source Code on GitHub

    @Override
    protected ActiveMQConfiguration createActiveMQConfiguration()
    {
        ActiveMQConfiguration config = super.createActiveMQConfiguration();
        config.setTransactionManager(new JmsTransactionManager(config.getConnectionFactory()));
        return config;
    }