- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中bitronix.tm.resource.common.XAResourceProducer.startRecovery()
方法的一些代码示例,展示了XAResourceProducer.startRecovery()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAResourceProducer.startRecovery()
方法的具体详情如下:
包路径:bitronix.tm.resource.common.XAResourceProducer
类名称:XAResourceProducer
方法名:startRecovery
[英]Prepare the recoverable XAResource producer for recovery.
[中]为恢复准备可恢复的资源生成器。
代码示例来源:origin: bitronix/btm
/**
* 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();
}
}
代码示例来源:origin: bitronix/btm
/**
* 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();
}
}
代码示例来源:origin: org.mule.btm/mule-btm
/**
* 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();
}
}
代码示例来源:origin: com.github.marcus-nl.btm/btm
private Future registerBlockingProducer(final XAResourceProducer producer, final CountDownLatch border) throws RecoveryException {
final XAResourceHolderState resourceHolderState = producer.startRecovery();
when(producer.startRecovery()).thenAnswer(new Answer<Object>() {
public Object answer(InvocationOnMock invocation) throws Throwable {
border.await();
return resourceHolderState;
}
});
return executorService.submit(new Callable<Object>() {
public Object call() throws Exception {
ResourceRegistrar.register(producer);
return null;
}
});
}
代码示例来源:origin: bitronix/btm
/**
* 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();
}
}
代码示例来源:origin: org.codehaus.btm/btm
/**
* 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();
}
}
代码示例来源:origin: org.codehaus.btm/btm
/**
* 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();
}
}
代码示例来源:origin: com.github.marcus-nl.btm/btm
/**
* 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();
}
}
代码示例来源:origin: org.mule.btm/mule-btm
/**
* 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();
}
}
代码示例来源:origin: bitronix/btm
private Future registerBlockingProducer(final XAResourceProducer producer, final CountDownLatch border) throws RecoveryException {
final XAResourceHolderState resourceHolderState = producer.startRecovery();
when(producer.startRecovery()).thenAnswer(new Answer<Object>() {
public Object answer(InvocationOnMock invocation) throws Throwable {
border.await();
return resourceHolderState;
}
});
return executorService.submit(new Callable<Object>() {
public Object call() throws Exception {
ResourceRegistrar.register(producer);
return null;
}
});
}
代码示例来源:origin: com.github.marcus-nl.btm/btm
/**
* 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();
}
}
代码示例来源:origin: org.mule.btm/mule-btm
/**
* 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();
}
}
代码示例来源:origin: com.github.marcus-nl.btm/btm
/**
* 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();
}
}
代码示例来源:origin: org.codehaus.btm/btm
/**
* 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();
}
}
代码示例来源:origin: com.github.marcus-nl.btm/btm
private XAResourceProducer createMockProducer(String uniqueName) throws RecoveryException {
XAResourceProducer producer;
producer = mock(XAResourceProducer.class);
when(producer.getUniqueName()).thenReturn(uniqueName);
ResourceBean resourceBean = mock(ResourceBean.class);
when(resourceBean.getUniqueName()).thenReturn(uniqueName);
XAResourceHolder resourceHolder = mock(XAResourceHolder.class);
when(resourceHolder.getResourceBean()).thenReturn(resourceBean);
XAResource xaResource = mock(XAResource.class);
when(resourceHolder.getXAResource()).thenReturn(xaResource);
when(producer.startRecovery()).thenReturn(new XAResourceHolderState(resourceHolder, resourceBean));
return producer;
}
代码示例来源:origin: bitronix/btm
private XAResourceProducer createMockProducer(String uniqueName) throws RecoveryException {
XAResourceProducer producer;
producer = mock(XAResourceProducer.class);
when(producer.getUniqueName()).thenReturn(uniqueName);
ResourceBean resourceBean = mock(ResourceBean.class);
when(resourceBean.getUniqueName()).thenReturn(uniqueName);
XAResourceHolder resourceHolder = mock(XAResourceHolder.class);
when(resourceHolder.getResourceBean()).thenReturn(resourceBean);
XAResource xaResource = mock(XAResource.class);
when(resourceHolder.getXAResource()).thenReturn(xaResource);
when(producer.startRecovery()).thenReturn(new XAResourceHolderState(resourceHolder, resourceBean));
return producer;
}
代码示例来源:origin: bitronix/btm
XAResourceHolderState xaResourceHolderState = xaResourceProducer.startRecovery();
boolean success = true;
Set<BitronixXid> xids = RecoveryHelper.recover(xaResourceHolderState);
代码示例来源:origin: org.codehaus.btm/btm
XAResourceHolderState xaResourceHolderState = xaResourceProducer.startRecovery();
boolean success = true;
Set<BitronixXid> xids = RecoveryHelper.recover(xaResourceHolderState);
代码示例来源:origin: com.github.marcus-nl.btm/btm
@Test
public void testNonRecoverableProducersAreNotRegistered() throws Exception {
final XAResourceProducer producer = createMockProducer("non-recoverable");
when(producer.startRecovery()).thenThrow(new RecoveryException("recovery not possible"));
try {
ResourceRegistrar.register(producer);
fail("expecting RecoveryException");
} catch (RecoveryException e) {
assertNull(ResourceRegistrar.get("non-recoverable"));
}
}
代码示例来源:origin: bitronix/btm
@Test
public void testNonRecoverableProducersAreNotRegistered() throws Exception {
final XAResourceProducer producer = createMockProducer("non-recoverable");
when(producer.startRecovery()).thenThrow(new RecoveryException("recovery not possible"));
try {
ResourceRegistrar.register(producer);
fail("expecting RecoveryException");
} catch (RecoveryException e) {
assertNull(ResourceRegistrar.get("non-recoverable"));
}
}
本文整理了Java中bitronix.tm.internal.XAResourceHolderState类的一些代码示例,展示了XAResourceHolderState类的具体用法。这些代码示例主要
我的一个应用程序有问题。该应用程序是一个自行编写的 Java 应用程序,它通过 JMS 连接到 50 多个不同的消息队列并使用来自这些队列的消息。 从功能的角度来看,来自不同队列的所有消息的处理工作正
我正在尝试创建事务管理器并将其与 Hibernate for Oracle 一起使用。 我的 persistence.xml 文件是: org.hibernate.ejb.Hiber
我的目标是使用 Bitronix 交易,我应该使用两种资源: 数据库 JMS 我有以下java代码: package com.mycompany.app; import java.net.URI; i
您好,我有一个使用 spring 和 hibernate 的 Java web 应用程序。 我有一个名为Role 的模型类。对于所有模型类,都有通用的 GenericDao.java public i
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.isFailed()方法的一些代码示例,展示了XAResourceHolderState.is
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getTwoPcOrderingPosition()方法的一些代码示例,展示了XAResour
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.isSuspended()方法的一些代码示例,展示了XAResourceHolderState
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.start()方法的一些代码示例,展示了XAResourceHolderState.start
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getXAResource()方法的一些代码示例,展示了XAResourceHolderSta
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getUseTmJoin()方法的一些代码示例,展示了XAResourceHolderStat
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.setXid()方法的一些代码示例,展示了XAResourceHolderState.setX
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.end()方法的一些代码示例,展示了XAResourceHolderState.end()的具
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.setTransactionTimeoutDate()方法的一些代码示例,展示了XAResou
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getIgnoreRecoveryFailures()方法的一些代码示例,展示了XAResou
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.isEnded()方法的一些代码示例,展示了XAResourceHolderState.isE
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getUniqueName()方法的一些代码示例,展示了XAResourceHolderSta
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getXid()方法的一些代码示例,展示了XAResourceHolderState.getX
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.equals()方法的一些代码示例,展示了XAResourceHolderState.equa
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getXAResourceHolder()方法的一些代码示例,展示了XAResourceHol
我是一名优秀的程序员,十分优秀!