@Bean(initMethod = "init", destroyMethod = "shutdownForce") @ConditionalOnMissingBean(UserTransactionService.class) public UserTransactionServiceImp userTransactionService( AtomikosProperties atomikosProperties) { Properties properties = new Properties(); if (StringUtils.hasText(this.jtaProperties.getTransactionManagerId())) { properties.setProperty("com.atomikos.icatch.tm_unique_name", this.jtaProperties.getTransactionManagerId()); } properties.setProperty("com.atomikos.icatch.log_base_dir", getLogBaseDir()); properties.putAll(atomikosProperties.asProperties()); return new UserTransactionServiceImp(properties); }
@Test public void atomikosSanityCheck() throws Exception { this.context = new AnnotationConfigApplicationContext(JtaProperties.class, AtomikosJtaConfiguration.class); this.context.getBean(AtomikosProperties.class); this.context.getBean(UserTransactionService.class); this.context.getBean(UserTransactionManager.class); this.context.getBean(UserTransaction.class); this.context.getBean(XADataSourceWrapper.class); this.context.getBean(XAConnectionFactoryWrapper.class); this.context.getBean(AtomikosDependsOnBeanFactoryPostProcessor.class); this.context.getBean(JtaTransactionManager.class); }
@Bean @ConditionalOnMissingBean @ConfigurationProperties(prefix = JtaProperties.PREFIX) public AtomikosProperties atomikosProperties() { return new AtomikosProperties(); }