/**@class android.database.sqlite.SQLiteConnectionPool implements java.io.Closeable @extends java.lang.Object Maintains a pool of active SQLite database connections. <p> At any given time, a connection is either owned by the pool, or it has been acquired by a {@link android.database.sqlite.SQLiteSession}. When the {@link android.database.sqlite.SQLiteSession} is finished with the connection it is using, it must return the connection back to the pool. </p><p> The pool holds strong references to the connections it owns. However, it only holds <em>weak references</em> to the connections that sessions have acquired from it. Using weak references in the latter case ensures that the connection pool can detect when connections have been improperly abandoned so that it can create new connections to replace them if needed. </p><p> The connection pool is thread-safe (but the connections themselves are not). </p> <h2>Exception safety</h2> <p> This code attempts to maintain the invariant that opened connections are always owned. Unfortunately that means it needs to handle exceptions all over to ensure that broken connections get cleaned up. Most operations invokving SQLite can throw {@link android.database.sqlite.SQLiteException} or other runtime exceptions. This is a bit of a pain to deal with because the compiler cannot help us catch missing exception handling code. </p><p> The general rule for this file: If we are making calls out to {@link android.database.sqlite.SQLiteConnection} then we must be prepared to handle any runtime exceptions it might throw at us. Note that out-of-memory is an {@link Error}, not a {@link RuntimeException}. We don't trouble ourselves handling out of memory because it is hard to do anything at all sensible then and most likely the VM is about to crash. </p> @hide */ var SQLiteConnectionPool = { /** Connection flag: Read-only. <p> This flag indicates that the connection will only be used to perform read-only operations. </p> */ CONNECTION_FLAG_READ_ONLY : "1", /** Connection flag: Primary connection affinity. <p> This flag indicates that the primary connection is required. This flag helps support legacy applications that expect most data modifying operations to be serialized by locking the primary database connection. Setting this flag essentially implements the old "db lock" concept by preventing an operation from being performed until it can obtain exclusive access to the primary connection. </p> */ CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY : "2", /** Connection flag: Connection is being used interactively. <p> This flag indicates that the connection is needed by the UI thread. The connection pool can use this flag to elevate the priority of the database connection request. </p> */ CONNECTION_FLAG_INTERACTIVE : "4", /**Opens a connection pool for the specified database. @param {Object {SQLiteDatabaseConfiguration}} configuration The database configuration. @return {Object {android.database.sqlite.SQLiteConnectionPool}} The connection pool. @throws SQLiteException if a database error occurs. */ open : function( ) {}, /**Closes the connection pool. <p> When the connection pool is closed, it will refuse all further requests to acquire connections. All connections that are currently available in the pool are closed immediately. Any connections that are still in use will be closed as soon as they are returned to the pool. </p> @throws IllegalStateException if the pool has been closed. */ close : function( ) {}, /**Reconfigures the database configuration of the connection pool and all of its connections. <p> Configuration changes are propagated down to connections immediately if they are available or as soon as they are released. This includes changes that affect the size of the pool. </p> @param {Object {SQLiteDatabaseConfiguration}} configuration The new configuration. @throws IllegalStateException if the pool has been closed. */ reconfigure : function( ) {}, /**Acquires a connection from the pool. <p> The caller must call {@link #releaseConnection} to release the connection back to the pool when it is finished. Failure to do so will result in much unpleasantness. </p> @param {String} sql If not null, try to find a connection that already has the specified SQL statement in its prepared statement cache. @param {Number} connectionFlags The connection request flags. @param {Object {CancellationSignal}} cancellationSignal A signal to cancel the operation in progress, or null if none. @return {Object {android.database.sqlite.SQLiteConnection}} The connection that was acquired, never null. @throws IllegalStateException if the pool has been closed. @throws SQLiteException if a database error occurs. @throws OperationCanceledException if the operation was canceled. */ acquireConnection : function( ) {}, /**Releases a connection back to the pool. <p> It is ok to call this method after the pool has closed, to release connections that were still in use at the time of closure. </p> @param {Object {SQLiteConnection}} connection The connection to release. Must not be null. @throws IllegalStateException if the connection was not acquired from this pool or if it has already been released. */ releaseConnection : function( ) {}, /**Returns true if the session should yield the connection due to contention over available database connections. @param {Object {SQLiteConnection}} connection The connection owned by the session. @param {Number} connectionFlags The connection request flags. @return {Boolean} True if the session should yield its connection. @throws IllegalStateException if the connection was not acquired from this pool or if it has already been released. */ shouldYieldConnection : function( ) {}, /**Collects statistics about database connection memory usage. @param {Object {java.util.ArrayList}} dbStatsList The list to populate. */ collectDbStats : function( ) {}, /**Set up the handler based on the provided looper and timeout. */ setupIdleConnectionHandler : function( ) {}, /**Dumps debugging information about this connection pool. @param {Object {Printer}} printer The printer to receive the dump, not null. @param {Boolean} verbose True to dump more verbose information. */ dump : function( ) {}, /** */ toString : function( ) {}, /** */ getPath : function( ) {}, };