Class JDBCPairwiseIdStore.ConnectionWithLock
java.lang.Object
net.shibboleth.idp.attribute.impl.JDBCPairwiseIdStore.ConnectionWithLock
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- JDBCPairwiseIdStore
A Class to encapsulate a
Connection
protected by an optional
read/write lock.
Because the class implements AutoCloseable
the unlock can "just happen"-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Connection
The connection we set up.private final Lock
The lock we may or may not have set up. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
commit()
Delegated operation to the encapsulatedConnection
.prepareStatement
(String sql) Delegated operation to the encapsulatedConnection
.
-
Field Details
-
connection
The connection we set up. -
threadLock
The lock we may or may not have set up.
-
-
Constructor Details
-
ConnectionWithLock
Constructor.- Parameters:
autoCommit
-writeLock
-- Throws:
SQLException
-
-
Method Details
-
prepareStatement
Delegated operation to the encapsulatedConnection
.- Parameters:
sql
- what to prepare- Returns:
- what the encapsulated
Connection
returns - Throws:
SQLException
- if encapsulatedConnection
does
-
commit
Delegated operation to the encapsulatedConnection
.- Throws:
SQLException
- if encapsulatedConnection
does
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-