gpt4 book ai didi

bitronix.tm.resource.common.XAResourceProducer.init()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 01:43:05 27 4
gpt4 key购买 nike

本文整理了Java中bitronix.tm.resource.common.XAResourceProducer.init()方法的一些代码示例,展示了XAResourceProducer.init()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAResourceProducer.init()方法的具体详情如下:
包路径:bitronix.tm.resource.common.XAResourceProducer
类名称:XAResourceProducer
方法名:init

XAResourceProducer.init介绍

[英]Initialize this XAResourceProducer's internal resources.
[中]初始化此XAResourceProducer的内部资源。

代码示例

代码示例来源:origin: com.github.marcus-nl.btm/btm

/**
 * Initialize {@link XAResourceProducer}s given a set of properties.
 * @param properties the properties to use for initialization.
 * @return the number of resources which failed to initialize.
 */
int initXAResourceProducers(Properties properties) {
  Map<String, List<PropertyPair>> entries = buildConfigurationEntriesMap(properties);
  int errorCount = 0;
  for (Map.Entry<String, List<PropertyPair>> entry : entries.entrySet()) {
    String uniqueName = entry.getKey();
    List<PropertyPair> propertyPairs = entry.getValue();
    XAResourceProducer producer = buildXAResourceProducer(uniqueName, propertyPairs);
    if (ResourceRegistrar.get(producer.getUniqueName()) != null) {
      if (log.isDebugEnabled()) { log.debug("resource already registered, skipping it:" + producer.getUniqueName()); }
      continue;
    }
    if (log.isDebugEnabled()) { log.debug("creating resource " + producer); }
    try {
      producer.init();
    } catch (ResourceConfigurationException ex) {
      log.warn("unable to create resource with unique name " + producer.getUniqueName(), ex);
      producer.close();
      errorCount++;
    }
    resourcesByUniqueName.put(producer.getUniqueName(), producer);
  }
  return errorCount;
}

代码示例来源:origin: bitronix/btm

/**
 * Initialize {@link XAResourceProducer}s given a set of properties.
 * @param properties the properties to use for initialization.
 * @return the number of resources which failed to initialize.
 */
int initXAResourceProducers(Properties properties) {
  Map<String, List<PropertyPair>> entries = buildConfigurationEntriesMap(properties);
  int errorCount = 0;
  for (Map.Entry<String, List<PropertyPair>> entry : entries.entrySet()) {
    String uniqueName = entry.getKey();
    List<PropertyPair> propertyPairs = entry.getValue();
    XAResourceProducer producer = buildXAResourceProducer(uniqueName, propertyPairs);
    if (ResourceRegistrar.get(producer.getUniqueName()) != null) {
      if (log.isDebugEnabled()) { log.debug("resource already registered, skipping it:" + producer.getUniqueName()); }
      continue;
    }
    if (log.isDebugEnabled()) { log.debug("creating resource " + producer); }
    try {
      producer.init();
    } catch (ResourceConfigurationException ex) {
      log.warn("unable to create resource with unique name " + producer.getUniqueName(), ex);
      producer.close();
      errorCount++;
    }
    resourcesByUniqueName.put(producer.getUniqueName(), producer);
  }
  return errorCount;
}

代码示例来源:origin: org.codehaus.btm/btm

/**
 * Initialize {@link XAResourceProducer}s given a set of properties.
 * @param properties the properties to use for initialization.
 * @return the number of resources which failed to initialize.
 */
int initXAResourceProducers(Properties properties) {
  Map<String, List<PropertyPair>> entries = buildConfigurationEntriesMap(properties);
  int errorCount = 0;
  for (Map.Entry<String, List<PropertyPair>> entry : entries.entrySet()) {
    String uniqueName = entry.getKey();
    List<PropertyPair> propertyPairs = entry.getValue();
    XAResourceProducer producer = buildXAResourceProducer(uniqueName, propertyPairs);
    if (ResourceRegistrar.get(producer.getUniqueName()) != null) {
      if (log.isDebugEnabled()) log.debug("resource already registered, skipping it:" + producer.getUniqueName());
      continue;
    }
    if (log.isDebugEnabled()) log.debug("creating resource " + producer);
    try {
      producer.init();
    } catch (ResourceConfigurationException ex) {
      log.warn("unable to create resource with unique name " + producer.getUniqueName(), ex);
      producer.close();
      errorCount++;
    }
    resourcesByUniqueName.put(producer.getUniqueName(), producer);
  }
  return errorCount;
}

代码示例来源:origin: org.mule.btm/mule-btm

/**
 * Initialize {@link XAResourceProducer}s given a set of properties.
 * @param properties the properties to use for initialization.
 * @return the number of resources which failed to initialize.
 */
int initXAResourceProducers(Properties properties) {
  Map<String, List<PropertyPair>> entries = buildConfigurationEntriesMap(properties);
  int errorCount = 0;
  for (Map.Entry<String, List<PropertyPair>> entry : entries.entrySet()) {
    String uniqueName = entry.getKey();
    List<PropertyPair> propertyPairs = entry.getValue();
    XAResourceProducer producer = buildXAResourceProducer(uniqueName, propertyPairs);
    if (ResourceRegistrar.get(producer.getUniqueName()) != null) {
      if (log.isDebugEnabled()) log.debug("resource already registered, skipping it:" + producer.getUniqueName());
      continue;
    }
    if (log.isDebugEnabled()) log.debug("creating resource " + producer);
    try {
      producer.init();
    } catch (ResourceConfigurationException ex) {
      log.warn("unable to create resource with unique name " + producer.getUniqueName(), ex);
      producer.close();
      errorCount++;
    }
    resourcesByUniqueName.put(producer.getUniqueName(), producer);
  }
  return errorCount;
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com