Search in sources :

Example 1 with UserTransactionServiceImp

use of com.atomikos.icatch.config.UserTransactionServiceImp in project spring-boot by spring-projects.

the class AtomikosJtaConfiguration method userTransactionService.

@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);
}
Also used : EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) Properties(java.util.Properties) AtomikosProperties(org.springframework.boot.jta.atomikos.AtomikosProperties) UserTransactionServiceImp(com.atomikos.icatch.config.UserTransactionServiceImp) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

UserTransactionServiceImp (com.atomikos.icatch.config.UserTransactionServiceImp)1 Properties (java.util.Properties)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)1 AtomikosProperties (org.springframework.boot.jta.atomikos.AtomikosProperties)1 Bean (org.springframework.context.annotation.Bean)1