This diagram is intended to help understand how the library works internally. It may leak some implementation details and should not be used as API.
DualConnection#Builder
creates DualConnection when
CircuitBreaker is closed.
The builder returns a connection to the main database when CircuitBreaker
is open.
Every call that goes to the database directly through the connection or
one of the java.sql.Statement
implementations can be intercepted with
DatabaseCall.
ConnectionState is an internal class that is the source of truth to the current State. It can use ConnectionProvider to obtain a connection to a database. It utilises ReplicaConsistency while transitioning between states. StateListener is called on each transition.