本文整理了Java中org.jvnet.hk2.config.Transaction.addParticipant()
方法的一些代码示例,展示了Transaction.addParticipant()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.addParticipant()
方法的具体详情如下:
包路径:org.jvnet.hk2.config.Transaction
类名称:Transaction
方法名:addParticipant
[英]Enlists a new participant in this transaction
[中]在该事务中登记新参与者
代码示例来源:origin: javaee/glassfish
/**
* Enter a new Transaction, this method should return false if this object
* is already enlisted in another transaction, or cannot be enlisted with
* the passed transaction. If the object returns true, the object
* is enlisted in the passed transaction and cannot be enlisted in another
* transaction until either commit or abort has been issued.
*
* @param t the transaction to enlist with
* @return true if the enlisting with the passed transaction was accepted,
* false otherwise
*/
public synchronized boolean join(Transaction t) {
if (currentTx==null) {
currentTx = t;
t.addParticipant(this);
return true;
}
return false;
}
代码示例来源:origin: org.glassfish.hk2/config
/**
* Enter a new Transaction, this method should return false if this object
* is already enlisted in another transaction, or cannot be enlisted with
* the passed transaction. If the object returns true, the object
* is enlisted in the passed transaction and cannot be enlisted in another
* transaction until either commit or abort has been issued.
*
* @param t the transaction to enlist with
* @return true if the enlisting with the passed transaction was accepted,
* false otherwise
*/
public synchronized boolean join(Transaction t) {
if (currentTx==null) {
currentTx = t;
t.addParticipant(this);
return true;
}
return false;
}
代码示例来源:origin: com.sun.enterprise/config
/**
* Enter a new Transaction, this method should return false if this object
* is already enlisted in another transaction, or cannot be enlisted with
* the passed transaction. If the object returns true, the object
* is enlisted in the passed transaction and cannot be enlisted in another
* transaction until either commit or abort has been issued.
*
* @param t the transaction to enlist with
* @return true if the enlisting with the passed transaction was accepted,
* false otherwise
*/
public synchronized boolean join(Transaction t) {
if (currentTx==null) {
currentTx = t;
t.addParticipant(this);
return true;
}
return false;
}
代码示例来源:origin: org.glassfish.hk2/hk2-config
/**
* Enter a new Transaction, this method should return false if this object
* is already enlisted in another transaction, or cannot be enlisted with
* the passed transaction. If the object returns true, the object
* is enlisted in the passed transaction and cannot be enlisted in another
* transaction until either commit or abort has been issued.
*
* @param t the transaction to enlist with
* @return true if the enlisting with the passed transaction was accepted,
* false otherwise
*/
public synchronized boolean join(Transaction t) {
if (currentTx==null) {
currentTx = t;
t.addParticipant(this);
return true;
}
return false;
}
代码示例来源:origin: eclipse-ee4j/glassfish
/**
* Enter a new Transaction, this method should return false if this object
* is already enlisted in another transaction, or cannot be enlisted with
* the passed transaction. If the object returns true, the object
* is enlisted in the passed transaction and cannot be enlisted in another
* transaction until either commit or abort has been issued.
*
* @param t the transaction to enlist with
* @return true if the enlisting with the passed transaction was accepted,
* false otherwise
*/
public synchronized boolean join(Transaction t) {
if (currentTx==null) {
currentTx = t;
t.addParticipant(this);
return true;
}
return false;
}
内容来源于网络,如有侵权,请联系作者删除!