Package lu.kbra.pclib.db.connector
Class AbstractDatabaseConnector.CachedConnection
java.lang.Object
lu.kbra.pclib.db.connector.AbstractDatabaseConnector.CachedConnection
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
SingleDatabaseConnector.LockedSingleCachedConnection,ThreadLocalDatabaseConnector.PerThreadCachedConnection
- Enclosing class:
- AbstractDatabaseConnector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicBooleanprotected final Connectionprotected final longprotected final AtomicBooleanprotected final AtomicInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidprotected abstract voidprotected voidbooleanisUsableFor(long expectedGeneration) booleanisValid()use()
-
Field Details
-
users
-
connection
-
generation
protected final long generation -
invalidated
-
closed
-
-
Constructor Details
-
CachedConnection
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
DBException
-
getConnection
-
isUsableFor
- Throws:
DBException
-
isValid
- Throws:
DBException
-
use
public abstract AbstractDatabaseConnector.CachedConnection.ConnectionHolder use() throws DBException- Throws:
DBException
-
decrementUsers
protected void decrementUsers() -
forceClose
protected abstract void forceClose() -
incrementUsers
protected void incrementUsers()
-