public class AtomicConnection
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AtomicConnection.ConnectionCleanupAction |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicReference<java.sql.Connection> |
atomicReference |
protected LazyCleaner.Cleanable |
cleanable |
protected @Nullable AtomicConnection.ConnectionCleanupAction |
cleanupAction |
protected boolean |
logUnclosedConnections |
| Constructor and Description |
|---|
AtomicConnection(@NonNull java.lang.Object referent) |
AtomicConnection(@NonNull java.lang.Object referent,
boolean logUnclosedConnections) |
| Modifier and Type | Method and Description |
|---|---|
void |
clean() |
boolean |
compareAndSet(@Nullable java.sql.Connection expected,
@Nullable java.sql.Connection updated) |
@Nullable java.sql.Connection |
get() |
void |
set(@Nullable java.sql.Connection connection) |
void |
set(@Nullable java.sql.Connection connection,
boolean closePreviousConnection) |
void |
set(@Nullable java.sql.Connection connection,
@Nullable java.lang.Throwable openConnectionStacktrace,
boolean closePreviousConnection) |
protected final java.util.concurrent.atomic.AtomicReference<java.sql.Connection> atomicReference
protected boolean logUnclosedConnections
protected LazyCleaner.Cleanable cleanable
protected @Nullable AtomicConnection.ConnectionCleanupAction cleanupAction
public AtomicConnection(@NonNull java.lang.Object referent)
public AtomicConnection(@NonNull java.lang.Object referent,
boolean logUnclosedConnections)
public void clean()
public @Nullable java.sql.Connection get()
public void set(@Nullable java.sql.Connection connection,
boolean closePreviousConnection)
public void set(@Nullable java.sql.Connection connection)
public void set(@Nullable java.sql.Connection connection,
@Nullable java.lang.Throwable openConnectionStacktrace,
boolean closePreviousConnection)
public boolean compareAndSet(@Nullable java.sql.Connection expected,
@Nullable java.sql.Connection updated)