Package com.killcoding.datasource
Class ConnectionPool
java.lang.Object
com.killcoding.datasource.ConnectionPool
This class functions as a connection pool counter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Integer,Connection> Record all connection hash code -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanadd(Connection conn) booleanprotected voidprivate Integerget()protected Connectionprotected Map<Integer,Connection> list()List all connection hash codemap()List all connection hash codeprotected Booleanprotected voidprotected ObjectremoveConnectionIdleBeginMark(Integer hashCode) protected ObjectremoveConnectionMark(Integer hashCode) protected ObjectremoveConnectionOpenedAtMark(Integer hashCode) protected ObjectremoveConnectionUsingAtMark(Integer hashCode) protected ObjectsetConnectionIdleBeginMark(Integer hashCode, Date date) protected ObjectsetConnectionMark(Integer hashCode, Connection conn) protected ObjectsetConnectionOpenedAtMark(Integer hashCode, Date date) protected ObjectsetConnectionUsingAtMark(Integer hashCode, Date date) intsize()Get connection pool size
-
Field Details
-
CONNECTION_POOL
Record all connection hash code -
CONNECTION_THREAD_MARK
-
CONNECTION_MARK
-
CONNECTION_OPENED_AT_MARK
-
CONNECTION_USING_AT_MARK
-
CONNECTION_IDLE_BEGIN_MARK
-
-
Constructor Details
-
ConnectionPool
public ConnectionPool()New a ConnectionPool object
-
-
Method Details
-
map
List all connection hash code- Returns:
- Map - All connection hash code map
-
list
List all connection hash code- Returns:
- List - All connection hash code
-
size
Get connection pool size- Returns:
- int - All connection size
-
add
-
freed
-
removeAll
-
remove
-
contains
-
get
-
getOpenConnectionSize
-
getConnectionOpenedAtMark
-
removeConnectionOpenedAtMark
-
setConnectionOpenedAtMark
-
getConnectionUsingAtMark
-
removeConnectionUsingAtMark
-
setConnectionUsingAtMark
-
getConnectionMark
-
getConnection
-
removeConnectionMark
-
setConnectionMark
-
getConnectionIdleBeginMark
-
removeConnectionIdleBeginMark
-
setConnectionIdleBeginMark
-
getConnectionThreadMark
-