当前位置: 首页>>代码示例>>Java>>正文


Java TransactionManagerServices.getConfiguration方法代码示例

本文整理汇总了Java中bitronix.tm.TransactionManagerServices.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java TransactionManagerServices.getConfiguration方法的具体用法?Java TransactionManagerServices.getConfiguration怎么用?Java TransactionManagerServices.getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bitronix.tm.TransactionManagerServices的用法示例。


在下文中一共展示了TransactionManagerServices.getConfiguration方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stop

import bitronix.tm.TransactionManagerServices; //导入方法依赖的package包/类
@Override
public void stop(BundleContext context) throws Exception {
	BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
       tm.shutdown();

       tmRegistration.unregister();
       utRegistration.unregister();

       for (ServiceRegistration reg : dsRegistrations.values()) {
           reg.unregister();
       }
       dsRegistrations.clear();

       Configuration conf = TransactionManagerServices.getConfiguration();
       log.info(String.format("Stopped JTA for server ID '%s'.", conf.getServerId()));
}
 
开发者ID:bitronix,项目名称:btm,代码行数:17,代码来源:Activator.java

示例2: bitronixConfiguration

import bitronix.tm.TransactionManagerServices; //导入方法依赖的package包/类
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties("spring.jta.bitronix.properties")
public bitronix.tm.Configuration bitronixConfiguration() {
	bitronix.tm.Configuration config = TransactionManagerServices.getConfiguration();
	if (StringUtils.hasText(this.jtaProperties.getTransactionManagerId())) {
		config.setServerId(this.jtaProperties.getTransactionManagerId());
	}
	File logBaseDir = getLogBaseDir();
	config.setLogPart1Filename(new File(logBaseDir, "part1.btm").getAbsolutePath());
	config.setLogPart2Filename(new File(logBaseDir, "part2.btm").getAbsolutePath());
	config.setDisableJmx(true);
	return config;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:BitronixJtaConfiguration.java

示例3: bitronixConfiguration

import bitronix.tm.TransactionManagerServices; //导入方法依赖的package包/类
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = JtaProperties.PREFIX)
public bitronix.tm.Configuration bitronixConfiguration() {
	bitronix.tm.Configuration config = TransactionManagerServices.getConfiguration();
	if (StringUtils.hasText(this.jtaProperties.getTransactionManagerId())) {
		config.setServerId(this.jtaProperties.getTransactionManagerId());
	}
	File logBaseDir = getLogBaseDir();
	config.setLogPart1Filename(new File(logBaseDir, "part1.btm").getAbsolutePath());
	config.setLogPart2Filename(new File(logBaseDir, "part2.btm").getAbsolutePath());
	config.setDisableJmx(true);
	return config;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:15,代码来源:BitronixJtaConfiguration.java

示例4: btmConfig

import bitronix.tm.TransactionManagerServices; //导入方法依赖的package包/类
@Bean
public bitronix.tm.Configuration btmConfig() {
    bitronix.tm.Configuration configuration = TransactionManagerServices.getConfiguration();
    configuration.setServerId("spring-btm");
    configuration.setWarnAboutZeroResourceTransaction(true);
    configuration.setJournal(btmJournal);
    return configuration;
}
 
开发者ID:vladmihalcea,项目名称:high-performance-java-persistence,代码行数:9,代码来源:JTATransactionManagerConfiguration.java

示例5: btmConfig

import bitronix.tm.TransactionManagerServices; //导入方法依赖的package包/类
@Bean
public bitronix.tm.Configuration btmConfig() {
	bitronix.tm.Configuration cfg = TransactionManagerServices.getConfiguration();
	cfg.setServerId("spring-btm");
	return cfg;
}
 
开发者ID:debop,项目名称:spring-batch-experiments,代码行数:7,代码来源:JtaConfiguration.java

示例6: DiskJournal

import bitronix.tm.TransactionManagerServices; //导入方法依赖的package包/类
/**
 * Create an uninitialized disk journal. You must call open() prior you can use it.
 */
public DiskJournal() {
	configuration = TransactionManagerServices.getConfiguration();
	needsForce = new AtomicBoolean();
	activeTla = new AtomicReference<TransactionLogAppender>();
}
 
开发者ID:bitronix,项目名称:btm,代码行数:9,代码来源:DiskJournal.java

示例7: start

import bitronix.tm.TransactionManagerServices; //导入方法依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
	dsRegistrations = new HashMap<String, ServiceRegistration>();

	String configArea = context.getProperty("osgi.configuration.area").replace(" ", "%20");

       String btmPropFile = System.getProperty("bitronix.tm.configuration", "bitronix-default-config.properties");

       URI btmConfig = URI.create(configArea + btmPropFile);
       File cfgFile = new File(btmConfig);
       if (!cfgFile.exists()) {
       	cfgFile = new File(btmPropFile);
       	if (!cfgFile.exists()) {
       		throw new InitializationException("Configuration file not found: " + btmPropFile);
       	}
       }

       FileReader fileReader = new FileReader(cfgFile);
       Properties btmProperties = new Properties();
       try {
       	btmProperties.load(fileReader);
       }
       finally {
       	fileReader.close();
       }

       System.setProperty("bitronix.tm.configuration", cfgFile.getAbsolutePath());

       File resourceFile = cfgFile;
       String resourcePropFile = btmProperties.getProperty("bitronix.tm.resource.configuration");
       if (resourcePropFile != null) {
       	URI resourceConfig = URI.create(configArea + resourcePropFile);
       	resourceFile = new File(resourceConfig);
           if (!resourceFile.exists()) {
           	resourceFile = new File(resourcePropFile);
           	if (!resourceFile.exists()) {
           		throw new InitializationException("Configuration file not found: " + resourcePropFile);
           	}
           }
           System.setProperty("bitronix.tm.resource.configuration", resourceFile.getAbsolutePath());
       }

       TransactionManager tm = TransactionManagerServices.getTransactionManager();
       tmRegistration = context.registerService(TransactionManager.class.getName(), tm, null);
       utRegistration = context.registerService(UserTransaction.class.getName(), tm, null);

       Map<String, Integer> uniqueNameLineNumbers = rankingOfUniqueNameProperties(resourceFile);
       Map<String, XAResourceProducer> resources = TransactionManagerServices.getResourceLoader().getResources();

       for (Map.Entry<String, XAResourceProducer> me : resources.entrySet()) {
           Integer ranking = uniqueNameLineNumbers.get(me.getKey());
           if (ranking == null) {
               ranking = 1;
           }

           Dictionary<String, Object> props = new Hashtable<String, Object>();
           props.put("service.pid", me.getKey());
           props.put("service.ranking", ranking);
           props.put("osgi.jndi.serviceName", me.getKey());
           ServiceRegistration sr = context.registerService(DataSource.class.getName(), me.getValue(), props);
           dsRegistrations.put(me.getKey(), sr);
       }

       Configuration conf = TransactionManagerServices.getConfiguration();
       log.info(String.format("Started JTA for server ID '%s'.", conf.getServerId()));
}
 
开发者ID:bitronix,项目名称:btm,代码行数:67,代码来源:Activator.java


注:本文中的bitronix.tm.TransactionManagerServices.getConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。