/**
* <b>连接池中项的封装</b>
* <p>连接池中项的封装,每个项的属性有:
* <li>连接句柄</li>
* <li>使用标志</li>
* <li>唯一标识</li>
* </p>
* @author 汉娱网络.技术部.wanggl
*/
package com.handjoys.dbpool;
import java.sql.*;
/**
* <b>连接池中项的封装</b>
* <p>连接池中项的封装,每个项的属性有:
* <li>连接句柄</li>
* <li>使用标志</li>
* <li>唯一标识</li>
* </p>
* @author 汉娱网络.技术部.wanggl
* @since 1.1
*/
public class QueueItem {
/**
* 连接句柄
*/
private Connection con=null;
/**
* 使用标志 默认没有使用
*/
private boolean isUsed=false;
/**
* 唯一标识
*/
private long guid=0;
/**
* 事务状态信息,默认没有事务信息
*/
private int tranStatus=TransactionStatus.UnTransaciton;
/**
* 构造函数
*/
public QueueItem() {
this.guid=System.currentTimeMillis();
}
/**输出字符串
* @see java.lang.Object#toString()
*/
public String toString() {
return "Connection #"+this.guid;
}
/**
* <b>获取连接句柄</b>
* @return Returns the con.
*/
public Connection getCon() {
return con;
}
/**
* <b>设置连接句柄</b>
* @param con The con to set.
*/
public void setCon(Connection con) {
this.con = con;
}
/**
* <b>获取唯一标识</b>
* @return Returns the guid.
*/
public long getGuid() {
return guid;
}
/**
* <b>获取是否使用标识</b>
* @return Returns the isUsed.
*/
public boolean isUsed() {
return isUsed;
}
/**
* <b>设置是否使用标识</b>
* @param isUsed The isUsed to set.
*/
public void setUsed(boolean isUsed) {
this.isUsed = isUsed;
}
/**
* <b>获取事务状态信息</b>
* @return Returns the tranStatus.
*/
public int getTranStatus() {
return tranStatus;
}
/**
* <b>设置事务状态信息</b>
* @param tranStatus The tranStatus to set.
*/
public void setTranStatus(int tranStatus) {
this.tranStatus = tranStatus;
}
}