作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getXAResourceHolder()
方法的一些代码示例,展示了XAResourceHolderState.getXAResourceHolder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAResourceHolderState.getXAResourceHolder()
方法的具体详情如下:
包路径:bitronix.tm.internal.XAResourceHolderState
类名称:XAResourceHolderState
方法名:getXAResourceHolder
暂无
代码示例来源:origin: org.codehaus.btm/btm
/**
* Remove this transaction's {@link XAResourceHolderState} from all enlisted
* {@link bitronix.tm.resource.common.XAResourceHolder}s.
*/
public void clearXAResourceHolderStates() {
if (log.isDebugEnabled()) log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)");
Iterator<XAResourceHolderState> it = resources.iterator();
while (it.hasNext()) {
XAResourceHolderState xaResourceHolderState = it.next();
XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
// clear out the current state
resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
Map statesForGtrid = resourceHolder.getXAResourceHolderStatesForGtrid(gtrid);
if (statesForGtrid != null) log.warn("resource " + resourceHolder + " did not clean up " + statesForGtrid.size() + "transaction states for GTRID [" + gtrid + "]");
else if (log.isDebugEnabled()) log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]");
it.remove();
}
}
代码示例来源:origin: org.mule.btm/mule-btm
/**
* Remove this transaction's {@link XAResourceHolderState} from all enlisted
* {@link bitronix.tm.resource.common.XAResourceHolder}s.
*/
public void clearXAResourceHolderStates() {
if (log.isDebugEnabled()) log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)");
Iterator<XAResourceHolderState> it = resources.iterator();
while (it.hasNext()) {
XAResourceHolderState xaResourceHolderState = it.next();
XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
// clear out the current state
resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
Map statesForGtrid = resourceHolder.getXAResourceHolderStatesForGtrid(gtrid);
if (statesForGtrid != null) log.warn("resource " + resourceHolder + " did not clean up " + statesForGtrid.size() + "transaction states for GTRID [" + gtrid + "]");
else if (log.isDebugEnabled()) log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]");
it.remove();
}
}
代码示例来源:origin: bitronix/btm
/**
* Remove this transaction's {@link XAResourceHolderState} from all enlisted
* {@link bitronix.tm.resource.common.XAResourceHolder}s.
*/
public void clearXAResourceHolderStates() {
if (log.isDebugEnabled()) { log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)"); }
Iterator<XAResourceHolderState> it = resources.iterator();
while (it.hasNext()) {
XAResourceHolderState xaResourceHolderState = it.next();
XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
// clear out the current state
resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
boolean stillExists = resourceHolder.isExistXAResourceHolderStatesForGtrid(gtrid);
if (stillExists) log.warn("resource " + resourceHolder + " did not clean up " + resourceHolder.getXAResourceHolderStateCountForGtrid(gtrid) + "transaction states for GTRID [" + gtrid + "]");
else if (log.isDebugEnabled()) { log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]"); }
it.remove();
}
}
代码示例来源:origin: bitronix/btm
/**
* Resume all enlisted resources in the current transaction context.
* @throws XAException if the resource threw an exception during resume.
*/
public void resume() throws XAException {
// all XAResource needs to be re-enlisted but this must happen
// outside the Scheduler's iteration as enlist() can change the
// collection's content and confuse the iterator.
List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
for (XAResourceHolderState xaResourceHolderState : resources) {
if (log.isDebugEnabled()) { log.debug("resuming " + xaResourceHolderState); }
// If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
// re-enlisted. This must be done outside this loop or that will confuse the iterator!
toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
}
if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
if (log.isDebugEnabled()) { log.debug("re-enlisting resource " + xaResourceHolderState); }
try {
enlist(xaResourceHolderState);
xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
} catch (BitronixSystemException ex) {
throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
}
}
}
代码示例来源:origin: org.mule.btm/mule-btm
/**
* Resume all enlisted resources in the current transaction context.
* @throws XAException if the resource threw an exception during resume.
*/
public void resume() throws XAException {
// all XAResource needs to be re-enlisted but this must happen
// outside the Scheduler's iteration as enlist() can change the
// collection's content and confuse the iterator.
List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
for (XAResourceHolderState xaResourceHolderState : resources) {
if (log.isDebugEnabled()) log.debug("resuming " + xaResourceHolderState);
// If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
// re-enlisted. This must be done outside this loop or that will confuse the iterator!
toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
}
if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
if (log.isDebugEnabled()) log.debug("re-enlisting resource " + xaResourceHolderState);
try {
enlist(xaResourceHolderState);
xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
} catch (BitronixSystemException ex) {
throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
}
}
}
代码示例来源:origin: com.github.marcus-nl.btm/btm
/**
* Resume all enlisted resources in the current transaction context.
* @throws XAException if the resource threw an exception during resume.
*/
public void resume() throws XAException {
// all XAResource needs to be re-enlisted but this must happen
// outside the Scheduler's iteration as enlist() can change the
// collection's content and confuse the iterator.
List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
for (XAResourceHolderState xaResourceHolderState : resources) {
if (log.isDebugEnabled()) { log.debug("resuming " + xaResourceHolderState); }
// If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
// re-enlisted. This must be done outside this loop or that will confuse the iterator!
toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
}
if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
if (log.isDebugEnabled()) { log.debug("re-enlisting resource " + xaResourceHolderState); }
try {
enlist(xaResourceHolderState);
xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
} catch (BitronixSystemException ex) {
throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
}
}
}
代码示例来源:origin: com.github.marcus-nl.btm/btm
/**
* Remove this transaction's {@link XAResourceHolderState} from all enlisted
* {@link bitronix.tm.resource.common.XAResourceHolder}s.
*/
public void clearXAResourceHolderStates() {
if (log.isDebugEnabled()) { log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)"); }
Iterator<XAResourceHolderState> it = resources.iterator();
while (it.hasNext()) {
XAResourceHolderState xaResourceHolderState = it.next();
XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
// clear out the current state
resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
boolean stillExists = resourceHolder.isExistXAResourceHolderStatesForGtrid(gtrid);
if (stillExists) log.warn("resource " + resourceHolder + " did not clean up " + resourceHolder.getXAResourceHolderStateCountForGtrid(gtrid) + "transaction states for GTRID [" + gtrid + "]");
else if (log.isDebugEnabled()) { log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]"); }
it.remove();
}
}
代码示例来源:origin: org.codehaus.btm/btm
/**
* Resume all enlisted resources in the current transaction context.
* @throws XAException if the resource threw an exception during resume.
*/
public void resume() throws XAException {
// all XAResource needs to be re-enlisted but this must happen
// outside the Scheduler's iteration as enlist() can change the
// collection's content and confuse the iterator.
List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
for (XAResourceHolderState xaResourceHolderState : resources) {
if (log.isDebugEnabled()) log.debug("resuming " + xaResourceHolderState);
// If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
// re-enlisted. This must be done outside this loop or that will confuse the iterator!
toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
}
if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
if (log.isDebugEnabled()) log.debug("re-enlisting resource " + xaResourceHolderState);
try {
enlist(xaResourceHolderState);
xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
} catch (BitronixSystemException ex) {
throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
}
}
}
本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getXAResourceHolder()方法的一些代码示例,展示了XAResourceHol
我是一名优秀的程序员,十分优秀!