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


Java XAResourceProducer.endRecovery方法代码示例

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


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

示例1: recover

import bitronix.tm.resource.common.XAResourceProducer; //导入方法依赖的package包/类
/**
 * Run the recovery process on the target resource.
 * Step 1.
 * @return a Set of BitronixXids.
 * @param producer the {@link XAResourceProducer} to recover.
 * @throws javax.transaction.xa.XAException if {@link XAResource#recover(int)} call fails.
 * @throws RecoveryException if an error preventing recovery happened.
 */
private Set<BitronixXid> recover(XAResourceProducer producer) throws XAException, RecoveryException {
    if (producer == null)
        throw new IllegalArgumentException("recoverable resource cannot be null");

    try {
        if (log.isDebugEnabled()) { log.debug("running recovery on " + producer); }
        XAResourceHolderState xaResourceHolderState = producer.startRecovery();
        return RecoveryHelper.recover(xaResourceHolderState);
    } finally {
        producer.endRecovery();
    }
}
 
开发者ID:bitronix,项目名称:btm,代码行数:21,代码来源:Recoverer.java

示例2: commit

import bitronix.tm.resource.common.XAResourceProducer; //导入方法依赖的package包/类
/**
 * Commit the specified branch of a dangling transaction.
 * Step 2.
 * @param uniqueName the unique name of the resource on which the commit should be done.
 * @param xid the {@link Xid} to commit.
 * @return true when commit was successful.
 * @throws RecoveryException if an error preventing recovery happened.
 */
private boolean commit(String uniqueName, Xid xid) throws RecoveryException {
    XAResourceProducer producer = registeredResources.get(uniqueName);
    try {
        XAResourceHolderState xaResourceHolderState = producer.startRecovery();
        return RecoveryHelper.commit(xaResourceHolderState, xid);
    } finally {
        producer.endRecovery();
    }
}
 
开发者ID:bitronix,项目名称:btm,代码行数:18,代码来源:Recoverer.java

示例3: rollback

import bitronix.tm.resource.common.XAResourceProducer; //导入方法依赖的package包/类
/**
 * Rollback the specified branch of a dangling transaction.
 * Step 3.
 * @param uniqueName the unique name of the resource on which to rollback branches.
 * @param xid the {@link Xid} to rollback.
 * @return true when rollback was successful.
 * @throws RecoveryException if an error preventing recovery happened.
 */
private boolean rollback(String uniqueName, Xid xid) throws RecoveryException {
    XAResourceProducer producer = registeredResources.get(uniqueName);
    if (producer == null) {
        if (log.isDebugEnabled()) { log.debug("resource " + uniqueName + " has not recovered, skipping rollback"); }
        return false;
    }

    try {
        XAResourceHolderState xaResourceHolderState = producer.startRecovery();
        return RecoveryHelper.rollback(xaResourceHolderState, xid);
    } finally {
        producer.endRecovery();
    }
}
 
开发者ID:bitronix,项目名称:btm,代码行数:23,代码来源:Recoverer.java


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