Skip to content

Commit

Permalink
Add/fix doc comments, CHANGELOG, TODO.
Browse files Browse the repository at this point in the history
  • Loading branch information
swaldman committed Feb 25, 2024
1 parent 1c2a895 commit 16ccfea
Show file tree
Hide file tree
Showing 7 changed files with 634 additions and 19 deletions.
609 changes: 609 additions & 0 deletions 1

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-- Define connectionIsValidTimeout as an ordinary bean-style config parameter.
Previously users had to set a universal property (in c3p0.properties or System
properties) to set this timeout.
-- Use simplified isValid(...) based timeout by default, use traditional
ConnectionTester logic only when users specify or force a ConnectionTester
c3p0-0.10.0-pre4
-- Define (in a separate, Java 21, project) a loom virtual-threads based
TaskRunnerFactory, VirtualThreadPerTaskExecutorTaskRunnerFactory.
Expand Down
8 changes: 1 addition & 7 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
* Change defaults? Or just document simple recommendations?
- Use large-but-nonzero default for `maxAdminstrativeTaskTime`? (And change docs! Also, note in migration notes)
- Set `testConnectionOnCheckout` to `true` by default (Big migration note!)
* Eliminate source headers
* Connection testing revamp
- Implement connectionIsValidTimeout
- Break testing out into separate NullConnectionTester and ConnectionTester paths
- Simplify docs for default NullConnectionTesterPath, remove existing docs to an appendix
* Revise / update documentation
- Especially threading and connection testing
* Make loom warning about context classloader / privilege threads conditional on those actually being requested.
* Maybe optimize away effectiveStatementCache field from C3P0PooledConnectionPool.
8 changes: 4 additions & 4 deletions src/com/mchange/v2/c3p0/ConnectionCustomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,19 @@ public void onCheckIn( Connection c, String parentDataSourceIdentityToken )
* of your customizer can be canoncalized and shared.
*
* Often something like...
* <code><pre>
* <pre><code>
* public boolean equals( Object o ) { return this.getClass().equals( o.getClass() ); }
* </pre><code>
* </code></pre>
*/
public boolean equals( Object o );

/**
* keep consistent with equals()
*
* Often something like...
* <code><pre>
* <pre><code>
* public int hashCode() { return this.getClass().getName().hashCode(); }
* </pre><code>
* </code></pre>
*
*/
public int hashCode();
Expand Down
8 changes: 4 additions & 4 deletions src/com/mchange/v2/c3p0/ConnectionTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ public interface ConnectionTester extends Serializable
* of your ConnectionTester can be canoncalized and shared.
*
* Often something like...
* <code><pre>
* <pre><code>
* public boolean equals( Object o ) { return this.getClass().equals( o.getClass() ); }
* </pre><code>
* </code></pre>
*/
public boolean equals( Object o );

/**
* keep consistent with equals()
*
* Often something like...
* <code><pre>
* <pre><code>
* public int hashCode() { return this.getClass().getName().hashCode(); }
* </pre><code>
* </code></pre>
*
*/
public int hashCode();
Expand Down
8 changes: 4 additions & 4 deletions src/com/mchange/v2/c3p0/TaskRunnerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ public ThreadPoolReportingAsynchronousRunner createTaskRunner(
* of your factory can be canoncalized and shared.
*
* Often something like...
* <code><pre>
* <pre><code>
* public boolean equals( Object o ) { return this.getClass().equals( o.getClass() ); }
* </pre><code>
* </code></pre>
*/
public boolean equals( Object o );

/**
* keep consistent with equals()
*
* Often something like...
* <code><pre>
* <pre><code>
* public int hashCode() { return this.getClass().getName().hashCode(); }
* </pre><code>
* </code></pre>
*
*/
public int hashCode();
Expand Down
7 changes: 7 additions & 0 deletions src/com/mchange/v2/c3p0/TaskRunnerInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

import java.util.*;

/**
* All fields will always be supplied from configuration and calling code,
* the "if supported" stuff is just a reminder that TaskRunner implementations
* need not and may not support the provided config.
*
* (It's a fine idea to log a note, if some config will be ignored!)
*/
public final class TaskRunnerInit
{
public final int num_threads_if_supported;
Expand Down

0 comments on commit 16ccfea

Please sign in to comment.