gpt4 book ai didi

bitronix.tm.internal.XAResourceHolderState.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 18:45:05 29 4
gpt4 key购买 nike

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

XAResourceHolderState.<init>介绍

暂无

代码示例

代码示例来源:origin: ehcache/ehcache3

public XAResourceHolderState startRecovery() throws RecoveryException {
 if (recoveryXAResourceHolder != null) {
  throw new RecoveryException("recovery already in progress on " + this);
 }
 if (xaResourceHolders.isEmpty()) {
  throw new RecoveryException("no XAResource registered, recovery cannot be done on " + this);
 }
 recoveryXAResourceHolder = new RecoveryXAResourceHolder(xaResourceHolders.values().iterator().next());
 return new XAResourceHolderState(recoveryXAResourceHolder, this);
}

代码示例来源:origin: org.ehcache/ehcache-transactions

public XAResourceHolderState startRecovery() throws RecoveryException {
 if (recoveryXAResourceHolder != null) {
  throw new RecoveryException("recovery already in progress on " + this);
 }
 if (xaResourceHolders.isEmpty()) {
  throw new RecoveryException("no XAResource registered, recovery cannot be done on " + this);
 }
 recoveryXAResourceHolder = new RecoveryXAResourceHolder(xaResourceHolders.values().iterator().next());
 return new XAResourceHolderState(recoveryXAResourceHolder, this);
}

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

/**
 * {@inheritDoc}
 */
public XAResourceHolderState startRecovery() throws RecoveryException {
  if (recoveryXAResourceHolder != null) {
    throw new RecoveryException("recovery already in progress on " + this);
  }
  if (xaResourceHolders.isEmpty()) {
    throw new RecoveryException("no XAResource registered, recovery cannot be done on " + this);
  }
  recoveryXAResourceHolder = new RecoveryXAResourceHolder(xaResourceHolders.values().iterator().next());
  return new XAResourceHolderState(recoveryXAResourceHolder, this);
}

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

/**
 * {@inheritDoc}
 */
@Override
public XAResourceHolderState startRecovery() throws RecoveryException {
  if (recoveryXAResourceHolder != null) {
    throw new RecoveryException("recovery already in progress on " + this);
  }
  if (xaResourceHolders.isEmpty()) {
    throw new RecoveryException("no XAResource registered, recovery cannot be done on " + this);
  }
  recoveryXAResourceHolder = new RecoveryXAResourceHolder(xaResourceHolders.values().iterator().next());
  return new XAResourceHolderState(recoveryXAResourceHolder, this);
}

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

/**
 * {@inheritDoc}
 */
public XAResourceHolderState startRecovery() throws RecoveryException {
  if (recoveryXAResourceHolder != null) {
    throw new RecoveryException("recovery already in progress on " + this);
  }
  if (xaResourceHolders.isEmpty()) {
    throw new RecoveryException("no XAResource registered, recovery cannot be done on " + this);
  }
  recoveryXAResourceHolder = new RecoveryXAResourceHolder(xaResourceHolders.values().iterator().next());
  return new XAResourceHolderState(recoveryXAResourceHolder, this);
}

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

/**
 * {@inheritDoc}
 */
@Override
public XAResourceHolderState startRecovery() throws RecoveryException {
  if (recoveryXAResourceHolder != null) {
    throw new RecoveryException("recovery already in progress on " + this);
  }
  if (xaResourceHolders.isEmpty()) {
    throw new RecoveryException("no XAResource registered, recovery cannot be done on " + this);
  }
  recoveryXAResourceHolder = new RecoveryXAResourceHolder(xaResourceHolders.values().iterator().next());
  return new XAResourceHolderState(recoveryXAResourceHolder, this);
}

代码示例来源: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: 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: org.mule.btm/mule-btm

public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryConnectionHandle != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (JdbcConnectionHandle) pool.getConnectionHandle(false);
    recoveryXAResourceHolder = recoveryConnectionHandle.getPooledConnection().createRecoveryXAResourceHolder();
    return new XAResourceHolderState(recoveryConnectionHandle.getPooledConnection(), this);
  } catch (Exception ex) {
    throw new RecoveryException("cannot start recovery on " + this, ex);
  }
}

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

public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryConnectionHandle != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (JdbcConnectionHandle) pool.getConnectionHandle(false);
    recoveryXAResourceHolder = recoveryConnectionHandle.getPooledConnection().createRecoveryXAResourceHolder();
    return new XAResourceHolderState(recoveryConnectionHandle.getPooledConnection(), this);
  } catch (Exception ex) {
    throw new RecoveryException("cannot start recovery on " + this, ex);
  }
}

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

@Override
public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryConnectionHandle != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (Connection) pool.getConnectionHandle(false);
    PooledConnectionProxy pooledConnection = (PooledConnectionProxy) recoveryConnectionHandle;
    recoveryXAResourceHolder = pooledConnection.getPooledConnection().createRecoveryXAResourceHolder();
    return new XAResourceHolderState(pooledConnection.getPooledConnection(), this);
  } catch (Exception ex) {
    throw new RecoveryException("cannot start recovery on " + this, ex);
  }
}

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

@Override
public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryConnectionHandle != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (Connection) pool.getConnectionHandle(false);
    PooledConnectionProxy pooledConnection = (PooledConnectionProxy) recoveryConnectionHandle;
    recoveryXAResourceHolder = pooledConnection.getPooledConnection().createRecoveryXAResourceHolder();
    return new XAResourceHolderState(pooledConnection.getPooledConnection(), this);
  } catch (Exception ex) {
    throw new RecoveryException("cannot start recovery on " + this, ex);
  }
}

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

public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryPooledConnection != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (JmsConnectionHandle) pool.getConnectionHandle(false);
    recoveryPooledConnection = recoveryConnectionHandle.getPooledConnection();
    recoveryXAResourceHolder = recoveryPooledConnection.createRecoveryXAResourceHolder();
    return new XAResourceHolderState(recoveryXAResourceHolder, recoveryPooledConnection.getPoolingConnectionFactory());
  } catch (Exception ex) {
    throw new RecoveryException("error starting recovery", ex);
  }
}

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

@Override
public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryPooledConnection != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (JmsConnectionHandle) pool.getConnectionHandle(false);
    recoveryPooledConnection = recoveryConnectionHandle.getPooledConnection();
    recoveryXAResourceHolder = recoveryPooledConnection.createRecoveryXAResourceHolder();
    return new XAResourceHolderState(recoveryXAResourceHolder, recoveryPooledConnection.getPoolingConnectionFactory());
  } catch (Exception ex) {
    throw new RecoveryException("error starting recovery", ex);
  }
}

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

public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryPooledConnection != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (JmsConnectionHandle) pool.getConnectionHandle(false);
    recoveryPooledConnection = recoveryConnectionHandle.getPooledConnection();
    recoveryXAResourceHolder = recoveryPooledConnection.createRecoveryXAResourceHolder();
    return new XAResourceHolderState(recoveryXAResourceHolder, recoveryPooledConnection.getPoolingConnectionFactory());
  } catch (Exception ex) {
    throw new RecoveryException("error starting recovery", ex);
  }
}

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

@Override
public XAResourceHolderState startRecovery() throws RecoveryException {
  init();
  if (recoveryPooledConnection != null)
    throw new RecoveryException("recovery already in progress on " + this);
  try {
    recoveryConnectionHandle = (JmsConnectionHandle) pool.getConnectionHandle(false);
    recoveryPooledConnection = recoveryConnectionHandle.getPooledConnection();
    recoveryXAResourceHolder = recoveryPooledConnection.createRecoveryXAResourceHolder();
    return new XAResourceHolderState(recoveryXAResourceHolder, recoveryPooledConnection.getPoolingConnectionFactory());
  } catch (Exception ex) {
    throw new RecoveryException("error starting recovery", ex);
  }
}

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

public void testRemove() {
  Scheduler<XAResourceHolderState> resourceScheduler = new Scheduler<XAResourceHolderState>();
  XAResourceHolderState xarhs0 = new XAResourceHolderState(null, new MockResourceBean(0));
  XAResourceHolderState xarhs1 = new XAResourceHolderState(null, new MockResourceBean(1));
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  resourceScheduler.add(xarhs1, xarhs1.getTwoPcOrderingPosition());
  resourceScheduler.remove(xarhs0);
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  Iterator<XAResourceHolderState> it = resourceScheduler.iterator();
  assertTrue(it.hasNext());
  assertTrue(xarhs0 == it.next());
  it.remove();
  assertTrue(xarhs1 == it.next());
  it.remove();
}

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

public void testReverseRemove() {
  Scheduler<XAResourceHolderState> resourceScheduler = new Scheduler<XAResourceHolderState>();
  XAResourceHolderState xarhs0 = new XAResourceHolderState(null, new MockResourceBean(0));
  XAResourceHolderState xarhs1 = new XAResourceHolderState(null, new MockResourceBean(1));
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  resourceScheduler.add(xarhs1, xarhs1.getTwoPcOrderingPosition());
  resourceScheduler.remove(xarhs0);
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  Iterator<XAResourceHolderState> it = resourceScheduler.reverseIterator();
  assertTrue(it.hasNext());
  assertTrue(xarhs1 == it.next());
  it.remove();
  assertTrue(xarhs0 == it.next());
  it.remove();
}

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

public void testRemove() {
  Scheduler<XAResourceHolderState> resourceScheduler = new Scheduler<XAResourceHolderState>();
  XAResourceHolderState xarhs0 = new XAResourceHolderState(null, new MockResourceBean(0));
  XAResourceHolderState xarhs1 = new XAResourceHolderState(null, new MockResourceBean(1));
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  resourceScheduler.add(xarhs1, xarhs1.getTwoPcOrderingPosition());
  resourceScheduler.remove(xarhs0);
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  Iterator<XAResourceHolderState> it = resourceScheduler.iterator();
  assertTrue(it.hasNext());
  assertTrue(xarhs0 == it.next());
  it.remove();
  assertTrue(xarhs1 == it.next());
  it.remove();
}

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

public void testReverseRemove() {
  Scheduler<XAResourceHolderState> resourceScheduler = new Scheduler<XAResourceHolderState>();
  XAResourceHolderState xarhs0 = new XAResourceHolderState(null, new MockResourceBean(0));
  XAResourceHolderState xarhs1 = new XAResourceHolderState(null, new MockResourceBean(1));
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  resourceScheduler.add(xarhs1, xarhs1.getTwoPcOrderingPosition());
  resourceScheduler.remove(xarhs0);
  resourceScheduler.add(xarhs0, xarhs0.getTwoPcOrderingPosition());
  Iterator<XAResourceHolderState> it = resourceScheduler.reverseIterator();
  assertTrue(it.hasNext());
  assertTrue(xarhs1 == it.next());
  it.remove();
  assertTrue(xarhs0 == it.next());
  it.remove();
}

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